Please explain how to position elements in CSS like I'm Five
For further actions, you may consider blocking this person and/or reporting abuse
Please explain how to position elements in CSS like I'm Five
For further actions, you may consider blocking this person and/or reporting abuse
Timeless DEV post...
The most used technology by developers is not Javascript.
It's not Python or HTML.
It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.
I'm talking about Git and version control of course.
Patrick Zocli -
Adam Nathaniel Davis -
Shamsul huda -
Suraj Vishwakarma -
Once suspended, iandavid will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, iandavid will be able to comment and publish posts again.
Once unpublished, all posts by iandavid will become hidden and only accessible to themselves.
If iandavid is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to David Okpare.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag iandavid:
Unflagging iandavid will restore default visibility to their posts.
Top comments (3)
Let's say we have students going into a classroom one at a time. The usual way for them to take a seat is this: The first student takes the first seat in the front row. The second student takes the next seat in the front row, and so on. Once the first row is full, the students fill up the second row in the same manner, and so on.
Cases that don't fit very well with the classroom metaphor:
Absolute: This one is a bit tricky to explain using our classroom example. It's like
fixed
, except instead of positioning relative the the viewport (the classroom in our example), the element is positioned relative to the nearest "positioned" ancestor. "Positioned ancestor" means the first enclosing element who's position is set to something other thanstatic
. Maybe one way to look at it is like this: Let's say there is an area in the classroom with some computers. If we position a student in that computer area withabsolute
positioning, that means we have to check the immediate parent container, which in this case is the computer area. Is the computer area itself positioned with something besidesstatic
? If so, we will position the student relative to the computer area. If not, we go one level up and check whether that parent container (in our case, the classroom) has been positioned with something besidesstatic
, and so on.Sticky: This one is also hard explain using our simple example, so I'll just say that's it's used in the context of scrolling. If you want your element to stay visible when it would normally get scrolled out of view, that's where you can use
sticky
.learnlayout.com/position.html is a great reference for positioning and css layout more generally!
Thank you so much! Well understood!
what a great explanation!