Introduction to CSS Positioning

Let's learn about the different modes of CSS positioning.

We'll cover the following

CSS has a position property. Its values can be set to static, relative, absolute, and fixed.

What is CSS positioning?

CSS positioning is a way to “nudge” an HTML element, such as a div, in any direction we want, be it top, right, bottom, or left. Note that this “nudging” doesn’t remove the element from the normal document flow, it displaces it.

Here’s an example of three divs.

Each div’s display property is set to inline-block so that they all appear next to one another, rather than on top of one another.

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy