Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Relative Positioning Explained | Maîtrise du Positionnement CSS
Mise en page CSS, Effets et Sass

Relative Positioning Explained

Glissez pour afficher le menu

Relative positioning allows us to position an element visually relative to its original positioning. At the same time, the neighboring elements do not take the element's place.

position: relative;
psoition+relative+exmaple+version+2

We can use the properties of top, left, bottom, and right to indicate the visual displacement of an element with respect to its initial position. The values can be positive and negative in different units (px, %, etc.). Let's run the following example to see what effect we can get:

index.html

index.html

index.css

index.css

Note

It is essential to mention that there is no need to specify all top, bottom, left, and right properties for the element with the position value that differs from the static. It is enough to set one property for the vertical positioning (top or bottom) and one for the horizontal positioning (left or right).

question mark

What does the position: relative property do?

Sélectionnez la réponse correcte

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 2

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Section 2. Chapitre 2
some-alt