What does the `outline-color` property do in CSS?
A
Sets the color of the border B
Sets the color of the padding C
Sets the color of the outline around an element D
Sets the background color
Analysis & Theory
`outline-color` defines the color of the outline (not the border) around an element.
Which of the following is a correct way to set the outline color to red?
A
outline: red; B
outline-color: red; C
outline-color = red; D
outline-style: red;
Analysis & Theory
`outline-color: red;` is the correct syntax.
What happens if you set `outline-color` but do not specify `outline-style`?
A
The outline becomes dotted B
The outline is still visible C
The outline won't be visible D
The outline becomes red
Analysis & Theory
An outline will not appear unless `outline-style` is also defined (e.g., `solid`).
Which of these values can be used with `outline-color`?
A
Named colors like `blue` B
HEX values like `#ff0000` C
RGB values like `rgb(255,0,0)` D
All of the above
Analysis & Theory
`outline-color` supports named colors, HEX, RGB, HSL, and more.
What is the default value of `outline-color`?
A
red B
black C
invert D
transparent
Analysis & Theory
The default is `invert`, which tries to provide high contrast to the background.
What does the `invert` value do in `outline-color`?
A
Makes the outline invisible B
Sets the outline to the opposite of the background color C
Automatically chooses a high-contrast color D
Disables the outline
Analysis & Theory
`invert` lets the browser choose a color that contrasts well with the background.
Can `outline-color` be animated using CSS transitions?
A
Yes, it can be animated like border-color B
No, outline properties cannot be animated C
Only with JavaScript D
Only if outline is dashed
Analysis & Theory
`outline-color` can be animated using `transition` in CSS.
How do you remove the color from an outline while keeping the outline structure?
A
outline-color: none; B
outline-color: transparent; C
outline-style: hidden; D
outline: none;
Analysis & Theory
`outline-color: transparent;` hides the color but retains the outline space.
Which CSS property should be set along with `outline-color` to make the outline visible?
A
outline-width B
outline-style C
outline-radius D
outline-opacity
Analysis & Theory
`outline-style` must be defined (e.g., `solid`) for the outline to be visible.
How can you set a different color for outline on focus?
A
outline: blue onfocus; B
outline-focus: blue; C
:focus { outline-color: blue; } D
focus-outline: blue;
Analysis & Theory
Use the `:focus` pseudo-class to change `outline-color` when an element is focused.