CSS interview Question/ Answers Set – 3
Z-index is a property in CSS that is used to define the order of elements on a web page. It works on the basis of order indices, where a higher-order element will appear before a lower-order element. The default value of z-index is zero and can take on either a positive or negative number. Overlapping elements with a higher z-index cover those with a lower index. z-index property can have the following values:
- auto – Default value.
- initial – sets the property to its default value (0).
- number – Integer value. It can be positive or negative.
- inherit – Value inherited from the parent element.
Yes, it is possible using the “display” property with its value as “block”, to change the inline element into a block-level element.
- Universal Selector
- Element Type Selector
- ID Selector
- Class Selector