Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Relative Positioning | Item Positioning
Advanced CSS Techniques
course content

Contenido del Curso

Advanced CSS Techniques

Advanced CSS Techniques

1. Introduction
2. Item Positioning
3. Transitions
4. Animations
5. Transformations
6. Adaptive/responsive websites and apps
7. Preprocessors

book
Relative Positioning

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.

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:

html

index

css

index

js

index

copy

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

What does the `position: relative` property do?

What does the position: relative property do?

Selecciona la respuesta correcta

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 2
We're sorry to hear that something went wrong. What happened?
some-alt