Buzz Chronicles
Follow
  • Home
  • Threads
    • Daily Charts
    • Most Popular
    • Most Recent
  • Authors
  • Categories
    • Life
    • Tech
    • Culture
    • Politics
    • Society
    • Fun
    • See All Categories
  • About

ThomassRichards Authors Pratham πŸ‘¨β€πŸ’»πŸš€

7 days 30 days All time Recent Popular
Pratham \U0001f468\u200d\U0001f4bb\U0001f680
Pratham πŸ‘¨β€πŸ’»πŸš€...
@Prathkum
Positioning in CSS allows you to display your element wherever you want on the screen

But when I was learning it, I found it little bit confusingπŸ˜…

So in this thread I'll try to explain it in easiest manner with practical implementation. Let's start

THREADπŸ§΅πŸ‘‡


There are 5 values that you can pass in position property

- static
- relative
- absolute
- fixed
- sticky

In this thread we will be focusing on relative and absolute positioning as both are widely used

Let's start with understanding what document flow is?

πŸ“Œ Elements are displayed on the screen as they written in the HTML document

Consider the following piece of code:

H1, P, H3 and div are displayed on the screen in exact order as they written in the HTML file.


As now you know about document flow, let's start with Relative positioning

πŸ“Œ Relative Position

- Relative positioning do not take an element out of document flow
- Relative positioning is relative to element's original position which can be changed using offset

πŸ”Ή Relative position is relative to itself.

For example: Consider the code and output in the attached image below

As you can see red box is shifted 100px from left because I applied left offset after giving it relative positioning
TECH
  • Page 1 of 1
How does it work?
  • 💬 Reply to a thread with "@buzz_chronicles save" or "@buzz_chronicles save as category"
    🤖 Our bot will send you a link to your own folder on Buzz Chronicles. The thread will be saved in a form of an easy-to-read article
    📁 All your saved threads will be available at buzzchronicles.com/your_twitter_handle
Buzz Chronicles
  • Explore
  • Threads
  • Daily Charts
  • Authors
  • Categories
  • About
  • Terms of Service

Copyright © 2021 Buzz Chronicles - All right reserved