When trying to create a tooltip widget that appears above an element when hovered, which property and value pair is crucial to ensure that the tooltip does not affect the layout of surrounding elements when it is positioned?
- position: absolute, z-index: 1;
- display: none;
- visibility: hidden;
- opacity: 0;
The crucial property-value pair is position: absolute, z-index: 1;. This positions the tooltip absolutely, and the z-index ensures it appears above other elements. The other options either hide the tooltip completely or affect the layout of surrounding elements.
Loading...
Related Quiz
- What is the purpose of the CSS property display: flex;?
- A layout requires that a navigation menu be hidden off-screen and only appear when triggered on smaller screens to save space. What approach could be used to transition the menu on and off-screen responsively?
- The ________ filter in CSS is used to adjust the brightness of an element.
- You have a complex web page layout with nested elements. You want to specifically style an element that is the second child of its parent, regardless of the type of element. Which pseudo-class selector will ensure your style is applied correctly?
- What is the primary purpose of the grid-template-areas property?