DEV Community

Cover image for Css Postion: Relative VS Absolute
karim coda
karim coda

Posted on

Css Postion: Relative VS Absolute

#todayilearned

Summarize a concept that is new to you.

#beginners

"A journey of a thousand miles begins with a single step." -Chinese Proverb

#discuss

What color should the bike shed be?

#meta

Discuss all things Dev.to!

Alt Text

Relative

It's free and isn't associated with any element around it and doesn't affect any element.

Alt Text

Alt Text

The second element does affect it the result it does not anything ok when you write relative the next will happen
Alt Text
Alt Text

Example

Html

Alt Text

Css

Alt Text

Alt Text

The result

Alt Text

Absolute

Html

Alt Text

Css

Alt Text

Alt Text

The result

Alt Text

It's associated with the second element the end it is a different way between Relative and Absolute.

Top comments (0)