Challenge - 5 Problems
Border Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the output of this CSS border style?
Given the CSS below, what will be the visible border style on the element?
CSS
div {
border: 5px dashed red;
}Attempts:
2 left
💡 Hint
The border shorthand uses width, style, and color in that order.
✗ Incorrect
The border property sets width, style, and color. 'dashed' is a valid border style that creates a dashed line. So the element will have a 5px wide red dashed border.
🧠 Conceptual
intermediate2:00remaining
How many borders will be visible with this CSS?
Consider the CSS below. How many visible borders will the element have?
CSS
div {
border-top: 3px solid blue;
border-right: 3px solid blue;
border-bottom: 0;
border-left: none;
}Attempts:
2 left
💡 Hint
border-bottom: 0 and border-left: none both remove those borders.
✗ Incorrect
border-top and border-right are set to 3px solid blue, so they show. border-bottom: 0 and border-left: none remove those borders, so only two borders are visible.
❓ selector
advanced2:00remaining
Which CSS selector applies border only to paragraphs inside a section?
You want to add a 2px solid green border only to
elements inside
Attempts:
2 left
💡 Hint
The > selector means direct child, and space means any descendant.
✗ Incorrect
The selector 'section > p' targets only
elements that are direct children of with class 'section'.
❓ layout
advanced2:00remaining
What happens to element size with border-box vs content-box?
If an element has width: 200px and border: 10px solid black, what is the total width of the element with box-sizing: border-box vs content-box?
Attempts:
2 left
💡 Hint
border-box includes border inside width, content-box adds border outside width.
✗ Incorrect
With border-box, the border is included inside the 200px width, so total width is 200px. With content-box (default), border adds outside content width, so total width is 200 + 10*2 = 220px.
❓ accessibility
expert2:00remaining
Which border color choice best supports accessibility?
You want to add a border to a button for focus indication. Which border color choice best supports accessibility for users with low vision?
Attempts:
2 left
💡 Hint
High contrast colors help users with low vision see focus outlines clearly.
✗ Incorrect
Bright red (#FF0000) provides strong contrast on most backgrounds and is easily visible. Pure black or white may blend in depending on background. Medium gray has low contrast and is hard to see.