What is a tooltip in CSS?
B
A box that appears when hovering over an element
D
A permanent label attached to an element
Analysis & Theory
A tooltip is a small box that appears when a user hovers over an element, usually showing extra information.
Which HTML attribute is commonly used to create a default tooltip?
Analysis & Theory
The `title` attribute provides a default browser tooltip on hover.
Which CSS pseudo-class is typically used to trigger a custom tooltip on hover?
Analysis & Theory
`:hover` is used to style elements when the user hovers over them with a pointer device.
Which CSS property makes a tooltip box appear above other elements?
Analysis & Theory
`z-index` determines the stack order of elements; higher values appear above lower ones.
Which CSS property is used to hide the tooltip by default?
Analysis & Theory
`visibility: hidden;` is commonly used to hide the tooltip until it is triggered.
What is the correct positioning method to place a tooltip relative to its parent?
A
position: absolute; inside a relative parent
Analysis & Theory
`position: absolute;` positions the tooltip relative to its nearest `relative` parent container.
Which CSS property creates a fading tooltip effect?
C
opacity with transition
Analysis & Theory
Using `opacity` with `transition` creates a smooth fade-in/fade-out effect for tooltips.
Which unit is most commonly used to offset a tooltip above the element?
Analysis & Theory
Pixel (`px`) values are commonly used for precise tooltip positioning.
Which property would you animate to make a tooltip slide into view?
C
transform: translateY()
Analysis & Theory
`transform: translateY()` can be animated to slide the tooltip vertically into view.
What is a common method to create a triangle-shaped tooltip arrow using CSS?
B
Using `border` properties
Analysis & Theory
CSS triangles are often made using transparent borders and one colored side to create the arrow.