What does the `outline-offset` property do in CSS?
A
Moves the border inward
B
Moves the outline away from or closer to the element's border
D
Changes the outline color
Analysis & Theory
`outline-offset` controls the space between the element's border edge and its outline.
What is the default value of `outline-offset`?
Analysis & Theory
The default value of `outline-offset` is `0px`, meaning the outline is directly at the border.
Which of the following is a valid value for `outline-offset`?
Analysis & Theory
`outline-offset` accepts length units like `px`, `em`, etc. Percentages and `auto` are not valid.
What effect does a positive `outline-offset` have?
A
It brings the outline inside the element
B
It pushes the outline outward away from the border
C
It changes the outline color
Analysis & Theory
Positive values push the outline away from the element's border.
What happens if you use a negative value for `outline-offset`?
B
The outline moves inside the border
C
The border moves outside the element
Analysis & Theory
Negative values pull the outline inward, possibly overlapping the content or border.
Which unit is NOT valid for `outline-offset`?
Analysis & Theory
`outline-offset` does not support percentage values; only length units are allowed.
Why might a developer use `outline-offset`?
A
To add margin between elements
B
To visually separate outline from the border
D
To adjust spacing between text and padding
Analysis & Theory
`outline-offset` is used to separate the outline visually from the border.
What does `outline-offset: 0;` do?
B
Draws the outline directly on the border edge
C
Draws outline at the margin edge
D
Makes outline color transparent
Analysis & Theory
`outline-offset: 0;` places the outline directly on the outer border of the element.
Which property must be defined for `outline-offset` to have an effect?
Analysis & Theory
`outline-style` must be set (e.g., `solid`) for the outline and offset to be visible.
Is `outline-offset` inherited by child elements?
C
Only if `outline-style` is also inherited
D
Only with `inherit` keyword
Analysis & Theory
`outline-offset` is not inherited by default, but you can use `outline-offset: inherit;` to inherit it.