Ahmad Shadeed blogs the sentiment that we would not must lean on place: absolute as a lot as we would have up to now. For one factor: stacking parts. For instance, when you’ve got a stack of parts that ought to all go on prime of one another…
.stack {
show: grid;
}
.stack > * {
grid-area: 1 / -1;
}
All the weather occupy the identical grid cell at that time, however you’ll be able to nonetheless use alignment and justification to maneuver stuff round and get it wanting and behaving the way you need.
What you’re actually saying with place: absolute is I would like this ingredient to be totally faraway from the movement such that it doesn’t have an effect on different parts and different parts don’t have an effect on it. Typically you do, however arguably much less usually than your current CSS muscle reminiscence would have you ever imagine.
I’ll snag considered one of Ahmad’s concept right here:
Each the tag and the title are positioned in a method we would routinely consider utilizing absolute positioning. However once more, one thing like CSS Grid has all the alignment options we have to not solely stack them vertically, however place them proper the place we wish.
Direct Hyperlink to Article — Permalink
The put up Much less Absolute Positioning With Fashionable CSS appeared first on CSS-Methods. You’ll be able to assist CSS-Methods by being an MVP Supporter.
Subscribe to MarketingSolution.
Receive web development discounts & web design tutorials.
Now! Lets GROW Together!