Which HTML element is commonly used to create a navigation bar?
Analysis & Theory
`<nav>` is the semantic HTML5 element used specifically for navigation menus.
Which CSS property is typically used to place nav items horizontally?
Analysis & Theory
`float: left;` is often used to align navigation links side by side horizontally.
What is the purpose of `display: flex;` in a navigation bar?
A
To make the nav bar sticky
B
To align items horizontally or vertically with Flexbox
D
To create dropdown menus
Analysis & Theory
`display: flex;` enables flexible layout to align and space nav items easily.
Which property removes the default list bullet points from a navigation `<ul>`?
Analysis & Theory
`list-style: none;` removes bullet points from list items in a navigation menu.
Which property removes the underline from navigation links?
Analysis & Theory
`text-decoration: none;` removes the underline from anchor (`<a>`) tags.
Which CSS selector is used to target links inside a navigation bar when hovered?
Analysis & Theory
`nav a:hover` targets anchor tags inside a `<nav>` when they are hovered.
How can you center navigation links using Flexbox?
A
justify-content: center;
Analysis & Theory
`justify-content: center;` horizontally centers flex items inside a nav bar.
What property is commonly used to make a nav bar stick to the top of the page?
B
position: sticky; top: 0;
Analysis & Theory
`position: sticky; top: 0;` makes the nav bar stick to the top as you scroll.
Which CSS property helps space out navigation links evenly in Flexbox?
Analysis & Theory
`justify-content` (like `space-between`) distributes spacing between flex items.
What is a common method to make navigation responsive on mobile?
A
Using media queries to toggle a menu
C
Changing font-size only
Analysis & Theory
Media queries are used to change or hide/show navigation for smaller screens (e.g., hamburger menu).