Source:- CSS Interview Questions
If you’re on a free Medium plan, click here to read — Free Access
For more questions and answers visit our website at Frontend Interview Questions
CSS Interiew Questions For Freshers
Source:- CSS Interview Questions For Freshers
In CSS, there are several position properties that control the positioning of elements on a web page. Let’s explore each of these position properties with examples:
1. position: This property specifies the positioning method for an element. It can take several values:
— `static`: This is the default value, and elements are positioned according to the normal document flow.
— `relative`: Elements are positioned relative to their normal position. You can use the `top`, `bottom`, `left`, and `right` properties to offset the element from its original position.
— `absolute`: Elements are positioned relative to the nearest positioned ancestor or the containing block. If there is no positioned ancestor, it will be positioned relative to the initial containing block (usually the `` element).