Quiz: Styling
by
Tomas Trescak
Quiz
Test your understanding of the section content.
Content
Detailed description of the section content.
Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Why Next.js?
Next.js Introduction
Monorepos
Turborepo
Assignment 2.1: Blog - Client
Layouts and Pages
Fonts and Images
Styling
Quiz: Styling
Exercise: Styling
Server vs Client Components
Static and Dynamic Rendering
Leaderboards
Advanced React
Databases
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics
Quiz: Styling
by
Tomas Trescak
Quiz
Test your understanding of the section content.
Content
Detailed description of the section content.
Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Why Next.js?
Next.js Introduction
Monorepos
Turborepo
Assignment 2.1: Blog - Client
Layouts and Pages
Fonts and Images
Styling
Quiz: Styling
Exercise: Styling
Server vs Client Components
Static and Dynamic Rendering
Leaderboards
Advanced React
Databases
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics
Quiz
by
Tomas Trescak
· Styling
QUESTION 1
You're building a blog post component and want to add specific styles that only apply to that component. Which CSS approach is the best choice?
Global CSS
Tailwind CSS
External Stylesheet
CSS Modules
QUESTION 2
You need to apply a consistent font and background color across your entire blog. Where should you import the CSS for these styles?
In each individual blog post component
In a separate CSS file in the public directory
It doesn't matter where you import it
In the root layout component (app/layout.tsx)
QUESTION 3
You're using Tailwind CSS in your Next.js blog. Where do you typically include the @tailwind directives (e.g., @tailwind base;, @tailwind components;, @tailwind utilities;)?
Directly in your components where you use Tailwind classes
In a globals.css file (or similar) that is imported into the root layout
In the next.config.js file
In a separate JavaScript file that handles Tailwind configuration
QUESTION 4
You want to use a CSS framework like Bootstrap in your Next.js blog. How should you include the Bootstrap CSS?
Install Bootstrap and use its components directly without importing any CSS
Import the CSS file directly from the npm package in your root layout component
Copy and paste the Bootstrap CSS into your globals.css file
Use a tag in your HTML
QUESTION 5
You have a custom font file (my-font.woff2) that you want to use in your blog. You've already placed the font file in the public directory. Which is the correct way to include this font in your project?
Use the next/font/google API and import it in your root layout.
Import the font file in a global CSS file.
Use a tag in your HTML.
Use the next/font/local API and import it in your root layout.
QUESTION 6
Which of the following is NOT a recommended way to import styles in Next.js?
Importing a globals.css file into the root layout
Importing a CSS file directly from an npm package in your root layout
Using a tag in your HTML to include a stylesheet
Importing a .module.css file into a component
QUESTION 7
You are working on a blog post component and need to style a specific element within the component. Which of the following is the most appropriate way to apply the style?
Use a CSS-in-JS library.
Create a global CSS rule in globals.css.
Use inline styles directly on the element.
Create a CSS Module and import it into the component.
QUESTION 8
When should you use global CSS in a Next.js application?
For styles that are only needed in a specific section of a page.
For styling individual components.
For applying styles that are specific to a single page.
For styles that are used across the entire application, like base typography or layout.
This content is only available to registered users.
Please register at the
the home page.
Quiz
by
Tomas Trescak
· Styling
QUESTION 1
You're building a blog post component and want to add specific styles that only apply to that component. Which CSS approach is the best choice?
Tailwind CSS
External Stylesheet
Global CSS
CSS Modules
QUESTION 2
You need to apply a consistent font and background color across your entire blog. Where should you import the CSS for these styles?
In a separate CSS file in the public directory
In the root layout component (app/layout.tsx)
It doesn't matter where you import it
In each individual blog post component
QUESTION 3
You're using Tailwind CSS in your Next.js blog. Where do you typically include the @tailwind directives (e.g., @tailwind base;, @tailwind components;, @tailwind utilities;)?
In a separate JavaScript file that handles Tailwind configuration
In the next.config.js file
Directly in your components where you use Tailwind classes
In a globals.css file (or similar) that is imported into the root layout
QUESTION 4
You want to use a CSS framework like Bootstrap in your Next.js blog. How should you include the Bootstrap CSS?
Import the CSS file directly from the npm package in your root layout component
Install Bootstrap and use its components directly without importing any CSS
Copy and paste the Bootstrap CSS into your globals.css file
Use a tag in your HTML
QUESTION 5
You have a custom font file (my-font.woff2) that you want to use in your blog. You've already placed the font file in the public directory. Which is the correct way to include this font in your project?
Import the font file in a global CSS file.
Use the next/font/local API and import it in your root layout.
Use a tag in your HTML.
Use the next/font/google API and import it in your root layout.
QUESTION 6
Which of the following is NOT a recommended way to import styles in Next.js?
Importing a CSS file directly from an npm package in your root layout
Importing a .module.css file into a component
Importing a globals.css file into the root layout
Using a tag in your HTML to include a stylesheet
QUESTION 7
You are working on a blog post component and need to style a specific element within the component. Which of the following is the most appropriate way to apply the style?
Use inline styles directly on the element.
Use a CSS-in-JS library.
Create a global CSS rule in globals.css.
Create a CSS Module and import it into the component.
QUESTION 8
When should you use global CSS in a Next.js application?
For applying styles that are specific to a single page.
For styling individual components.
For styles that are only needed in a specific section of a page.
For styles that are used across the entire application, like base typography or layout.
This content is only available to registered users.
Please register at the
the home page.
Quiz: Styling
by
Tomas Trescak
Quiz: Styling
by
Tomas Trescak
Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Why Next.js?
Next.js Introduction
Monorepos
Turborepo
Assignment 2.1: Blog - Client
Layouts and Pages
Fonts and Images
Styling
Quiz: Styling
Exercise: Styling
Server vs Client Components
Static and Dynamic Rendering
Leaderboards
Advanced React
Databases
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics
Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Why Next.js?
Next.js Introduction
Monorepos
Turborepo
Assignment 2.1: Blog - Client
Layouts and Pages
Fonts and Images
Styling
Quiz: Styling
Exercise: Styling
Server vs Client Components
Static and Dynamic Rendering
Leaderboards
Advanced React
Databases
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics