What is the purpose of the `border` shorthand property in CSS?
A
To add shadows to borders B
To remove borders from all sides C
To set width, style, and color of a border in one line D
To set the border radius
Analysis & Theory
`border` shorthand combines border-width, border-style, and border-color in one declaration.
Which of the following is a correct usage of the `border` shorthand?
A
border: 2px red; B
border: dashed red; C
border: solid 3px; D
border: 2px solid red;
Analysis & Theory
`border: 2px solid red;` sets width, style, and color properly.
In the `border` shorthand, what is the correct order of values?
A
style, width, color B
color, style, width C
width, style, color D
width, color, style
Analysis & Theory
The proper order is: width → style → color (e.g., `2px solid red`).
Which of the following applies a border to all sides of an element?
A
border: 1px solid black; B
border-top: 1px solid black; C
border-all: 1px solid black; D
border-sides: all;
Analysis & Theory
`border: 1px solid black;` sets the border on all four sides.
What happens if you use `border: solid red;` without specifying width?
A
It will not show a border B
It uses default width C
It gives an error D
Only the top border appears
Analysis & Theory
CSS will apply a default width (usually `medium`) if none is specified.
Which of the following is a valid shorthand that makes a green dashed border?
A
border: green dashed; B
border: dashed green; C
border: 2px dashed green; D
border: green 2px dashed;
Analysis & Theory
`border: 2px dashed green;` correctly defines width, style, and color.
Can the `border` shorthand override individual border side properties?
A
Yes, it overrides all sides B
No, individual sides take priority C
Only for the top border D
Only if declared after the side borders
Analysis & Theory
`border` shorthand applies to all sides and overrides individual settings unless they come after.
What does `border: none;` do?
A
Makes the border white B
Removes all borders C
Hides the content D
Adds a hidden border
Analysis & Theory
`border: none;` removes the border from all sides.
Is it valid to use `border` shorthand in inline styles?
A
Yes B
No C
Only in external CSS D
Only with IDs
Analysis & Theory
You can use shorthand like: `<div style="border: 1px solid blue;">`.
Which of the following will result in no visible border?
A
border: 0; B
border: none; C
border: hidden; D
All of the above
Analysis & Theory
All listed values will hide or remove the border depending on use.