Which CSS property is used to change the color of a border?
A
border-style B
border-color C
border-shade D
border-fill
Analysis & Theory
`border-color` sets the color of an element’s border.
What is the correct way to set the border color to blue?
A
border-color: blue; B
border-color = blue; C
color-border: blue; D
border: color blue;
Analysis & Theory
`border-color: blue;` is the correct syntax.
Which of the following border colors is valid?
A
border-color: #ff0000; B
border-color: rgb(0,0,0); C
border-color: red; D
All of the above
Analysis & Theory
You can use color names, hex, or RGB values for `border-color`.
What happens if `border-style` is not defined?
A
The border uses a default color B
The border is hidden even with a color C
The border becomes dashed D
The border turns black
Analysis & Theory
`border-style` must be set (e.g., `solid`) for the border to be visible, even if a color is given.
Which property sets the color of the top border only?
A
border-top B
border-top-style C
border-top-color D
border-top-line
Analysis & Theory
`border-top-color` specifically changes the top border’s color.
How do you set different colors for each side of the border?
A
border-color: red green; B
border-color: red green blue yellow; C
border: color(red green blue yellow); D
border-color: [red, green, blue, yellow];
Analysis & Theory
`border-color: red green blue yellow;` sets top, right, bottom, and left colors.
What does `border-color: transparent;` do?
A
Removes the border B
Makes the border invisible but still takes up space C
Turns the border black D
Creates a white border
Analysis & Theory
`transparent` hides the color but the border's space and width remain.
Can `border-color` be used in the `border` shorthand?
A
Yes B
No C
Only with inline CSS D
Only with border-width
Analysis & Theory
`border: 2px solid red;` includes color as the third shorthand value.
What happens if you use `border-color` without setting a border?
A
Color is ignored B
A default border appears C
A dotted border appears D
The page crashes
Analysis & Theory
Without `border-style`, the border won’t be visible even if color is defined.
Which of the following is a correct combination to make a visible green border?
A
border: 2px solid green; B
border-color: green; C
border-style: solid; D
All of the above together
Analysis & Theory
To display a visible green border, you must define color, style, and width.