Similarity of inline-block and text?
Is inline block similar to text?
Ik thats odd but i find it odd'er that we can use css proerties of line-height and line-width?
Pretty wild so far 😄
4 Replies
I also notice that as you can see, the placement of the next element seems to be at the bottom of the other
I think thats baseline?
I realize now even font size effects it
Umm makes me wonder if inline-block is ideal at all now, maybe i can just stick to flex, that way no otherwise would be text properties wont effect the boxes themselves
I highly recommend watching this talk by Josh Comeau about CSS layout, which talks specifically about the applications of inline-block: https://youtu.be/kj7WGnUDaI4?t=897
Josh Comeau
YouTube
The Secret Mechanisms of CSS — Web à Québec
This is a recording from my May 2024 talk at the Web à Québec conference.
Essentially, this talk is a collection of the biggest epiphanies I've had about CSS after many many years of experimentation and self-education. My goal in this talk is to give you a set of mental models you can use to better understand CSS, so that it stops feeling so un...
What does it mean only inlineblock can line wrap?
Seems like inline also wraps?
Or is that better called some sort of "Box wrap"?
Think of
inline-block
as a middle point between inline
and block
.
It maintains some inline properties (such as line wrap) but also has some block properties so that you can define properties such as width, height and margin. There is of course more too it than that but those are the basics.