Much less Absolute Positioning With Fashionable CSS – Ahmad Shadeed
Ahmad Shadeed blogs the sentiment that we’d not have to lean on place: absolute
as a lot as we’d have previously. For one factor: stacking components. For instance, when you have a stack of components that ought to all go on high of one another…
.stack { show: grid;}.stack > * { grid-area: 1 / -1;}
All the weather occupy the identical grid cell at that time, however you possibly can nonetheless use alignment and justification to maneuver stuff round and get it trying and behaving the way you need.
What you might be actually saying with place: absolute
is I would like this ingredient to be completely faraway from the circulate
such that it doesn’t have an effect on different components and different components don’t have an effect on it. Typically you do, however arguably much less usually than your present CSS muscle reminiscence would have you ever consider.
I’ll snag one in all Ahmad’s thought right here:
Each the tag and the title are positioned in a method we’d robotically consider utilizing absolute positioning. However once more, one thing like CSS Grid has the entire alignment options we have to not solely stack them vertically, however place them proper the place we wish.
Direct Link to Article — Permalink
The put up Less Absolute Positioning With Modern CSS appeared first on CSS-Tricks. You may assist CSS-Methods by being an MVP Supporter.
Checkout extra Articles on Sayed.CYou
Comments
Post a Comment