0
0
CSSmarkup~20 mins

Border styles in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Border Style Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the output of this CSS code?
Given the CSS below, what will be the visible border style of the box in the browser?
CSS
div {
  border: 5px dashed red;
  width: 100px;
  height: 100px;
}
AA dashed red border 5px thick
BA dotted red border 5px thick
CA solid red border 5px thick
DNo border visible
Attempts:
2 left
💡 Hint
Look at the border style keyword used.
rendering
intermediate
2:00remaining
Which border style will create a double line border?
You want a border with two parallel lines around a box. Which CSS border style value should you use?
Aborder-style: groove;
Bborder-style: double;
Cborder-style: ridge;
Dborder-style: inset;
Attempts:
2 left
💡 Hint
Think about the name that suggests two lines.
selector
advanced
2:00remaining
Which CSS selector applies a border only to the top and bottom edges?
You want to add a 3px solid blue border only on the top and bottom edges of all paragraphs. Which CSS code achieves this?
Ap { border-top: 3px solid blue; border-bottom: 3px solid blue; }
Bp { border: 3px solid blue; border-left: none; border-right: none; }
Cp { border-top: 3px solid blue; border-right: 3px solid blue; }
Dp { border-top: 3px solid blue; border-bottom: 3px dotted blue; }
Attempts:
2 left
💡 Hint
Only top and bottom edges should have the border, and both must be solid blue.
accessibility
advanced
2:00remaining
Why is it important to consider border color contrast for accessibility?
You add a thin border around buttons for focus indication. Why should the border color have good contrast with the background?
ABecause only border width matters for accessibility.
BBecause border color does not affect accessibility.
CTo make the border blend with the background for a subtle look.
DTo ensure users with low vision can easily see the focus outline.
Attempts:
2 left
💡 Hint
Think about users who rely on visual cues to navigate.
layout
expert
2:00remaining
What is the visual effect of this CSS on the border layout?
Consider the CSS below applied to a container. What will the border look like in the browser?
CSS
div {
  border-width: 10px 5px 15px 0;
  border-style: solid;
  border-color: green;
  width: 150px;
  height: 100px;
}
AAll borders 10px solid green
BNo borders visible because left border width is zero
CTop border 10px, right 5px, bottom 15px, left 0 width (no border visible)
DTop border 10px, right 5px, bottom 15px, left no border
Attempts:
2 left
💡 Hint
Remember the order of border-width values: top, right, bottom, left.