Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What CSS property is used to set the style of a border?
The border-style property sets the style of an element's border, such as solid, dashed, or dotted.
Click to reveal answer
beginner
Name three common border styles in CSS.
Three common border styles are solid (a continuous line), dashed (a line made of dashes), and dotted (a line made of dots).
Click to reveal answer
beginner
How do you remove a border from an element using CSS?
Set border-style: none; or border: none; to remove the border completely.
Click to reveal answer
intermediate
What does the border-style: inset; do?
It creates a border that makes the element look like it is embedded or pressed into the page, giving a 3D effect.
Click to reveal answer
intermediate
Can you set different border styles for each side of an element? How?
Yes. Use border-top-style, border-right-style, border-bottom-style, and border-left-style to set styles individually.
Click to reveal answer
Which CSS value will create a dotted border?
Asolid
Bdotted
Cdouble
Dgroove
✗ Incorrect
The dotted value creates a border made of dots.
How do you remove all borders from an element?
Aborder-style: none;
Bborder-style: hidden;
Cborder-style: solid;
Dborder-style: dashed;
✗ Incorrect
Setting border-style: none; removes the border.
Which property sets the border style for the left side only?
Aborder-left
Bborder-style-left
Cborder-left-style
Dborder-style
✗ Incorrect
border-left-style sets the style for the left border only.
What border style gives a 3D pressed look?
Ainset
Bridge
Cdotted
Dsolid
✗ Incorrect
inset makes the border look pressed into the page.
Which border style creates two solid lines with space between?
Adashed
Bgroove
Csolid
Ddouble
✗ Incorrect
double creates two solid lines separated by space.
Explain how to set different border styles on each side of a box in CSS.
Think about how you can control each side separately.
You got /5 concepts.
Describe the visual difference between the border styles: solid, dashed, and dotted.
Imagine drawing lines with a pen, a dashed line, and dots.
You got /3 concepts.
Practice
(1/5)
1. Which CSS border-style value creates a solid continuous line around an element?
easy
A. double
B. dotted
C. none
D. solid
Solution
Step 1: Understand border-style values
The border-style property controls the line style of borders. Common values include solid, dotted, dashed, and double.
Step 2: Identify the solid line style
The solid value creates a continuous, unbroken line around the element.
Final Answer:
solid -> Option D
Quick Check:
Solid border = continuous line [OK]
Hint: Solid means one continuous line, no breaks [OK]
Common Mistakes:
Confusing 'dotted' with 'solid'
Choosing 'double' thinking it's solid
Selecting 'none' which means no border
2. Which of the following is the correct CSS syntax to set a dashed border style on a div?
easy
A. div { border-style: dash; }
B. div { border-style: dashed; }
C. div { border-style: dashes; }
D. div { border-style: dot; }
Solution
Step 1: Recall correct border-style values
The valid CSS value for a dashed border is dashed. Incorrect values like dash, dashes, or dot are not recognized.
Step 2: Check syntax correctness
The syntax border-style: dashed; correctly applies a dashed border style to the element.
Final Answer:
div { border-style: dashed; } -> Option B
Quick Check:
Dashed border uses 'dashed' keyword [OK]
Hint: Use 'dashed' exactly, not 'dash' or 'dashes' [OK]
Common Mistakes:
Using incorrect keywords like 'dash' or 'dot'
Missing semicolon at the end
Applying border-style to wrong selector
3. What will be the visible border style of this CSS code?
p {
border-width: 3px;
border-style: double;
border-color: blue;
}
medium
A. Two parallel blue lines with space between, total 3px thick
B. A single solid blue border 3px thick
C. A dotted blue border 3px thick
D. No visible border
Solution
Step 1: Understand the 'double' border style
The double border style draws two parallel lines with a small space between them. The total thickness is controlled by border-width.
Step 2: Apply the given CSS properties
The border is blue, 3px wide, and double style, so you see two blue lines side by side with a gap, all within 3px total width.
Final Answer:
Two parallel blue lines with space between, total 3px thick -> Option A
Quick Check:
Double border = two lines with gap [OK]
Hint: Double border shows two lines, not one [OK]
Common Mistakes:
Thinking 'double' means thicker solid line
Confusing 'double' with 'dotted'
Ignoring border-width effect
4. Identify the error in this CSS snippet that prevents the border from showing:
div {
border-style: solid;
border-width: 0;
border-color: red;
}
medium
A. border-width is set to 0, so border is invisible
B. Missing border property shorthand
C. border-color 'red' is not a valid color
D. border-style 'solid' is invalid
Solution
Step 1: Check border-width value
The border width is set to 0, which means no visible border thickness.
Step 2: Understand effect on border visibility
Even though style is solid and color is red, a 0 width border won't show on the page.
Final Answer:
border-width is set to 0, so border is invisible -> Option A
Quick Check:
Border width 0 means no visible border [OK]
Hint: Border width 0 hides border even if style and color set [OK]
Common Mistakes:
Thinking 'solid' is invalid
Assuming color affects visibility alone
Believing shorthand is required
5. You want to create a responsive card with a border that changes style on hover: solid normally and dotted on hover. Which CSS code correctly achieves this?