Top 30 CSS Interview Questions And Answers

Pravin M
34 min readJul 21, 2023
CSS Interview Questions

Source:- CSS Interview Questions

For more questions and answers visit our website at Frontend Interview Questions

CSS Interiew Questions For Freshers

Source:- CSS Interview Questions For Freshers

  1. Explain CSS position properties ?

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).

— `fixed`: Elements are positioned relative to the viewport and do not move even if the page is scrolled.

--

--