Sitemap

CSS Positioning

2 min readDec 11, 2023

--

As all of us know; CSS is a style sheet language that is used to style HTML elements. CSS stands for Cascading Style Sheets. Cascade is the conflict that occurs when there’s assigning more than one CSS rule to the same HTML element. CSS rule can be described as follows.

Here I’m going to bring you a brief explanation about CSS positioning. What is CSS positioning, how to do positioning and types of positions will be discussed…

CSS Positioning…
Positioning in CSS is a very important part which is using to position elements as it needs. We can control the position of an element using CSS positioning. When you reach to the end of the article, you’ll have a clear idea about it.

Types of CSS positions…
Let’s talk about CSS position types one by one.

Get CelestialDevStory’s stories in your inbox

Join Medium for free to get updates from this writer.

01. Static
This is the default position of an element.
Elements are positioned according to the flow of the page.

Press enter or click to view image in full size

02. Relative
Elements are positioned according to their original position.

Press enter or click to view image in full size

03. Absolute
Elements are positioned according to their parent’s position.

Press enter or click to view image in full size

04. Fixed
These elements are positioned relative to the viewport; when you scroll the page, the elements will not be moved.

05. Sticky
These elements act as relative elements until they reach the to or bottom of the page, then they’ll act as fixed elements.

It is my pleasure if you gained any knowledge from my post.
Don’t forget to leave a like & comment, if you have come this far through my blog post.😉

See you again with a new blog post.🍀👍

--

--

CelestialDevStory
CelestialDevStory

Written by CelestialDevStory

🌈Follow me if you're willing to explore the coding universe🌏with a software engineer👨‍💻excited to break complex coding barrier, turning it into a story💫🌘