Technical Blog

home blog interests e hoa mā about me

CSS Concepts

Topic: What does it mean to display inline vs inline blocks?

Everything has a default way of operating. Even you and I!

I brush my teeth a certain way, starting from my back left and then moving around the front then to my right. All this without thinking.

When I drink fizzy I always hiccup once right away on my first sip.

Some of these default things we do can be changed with some effort and specificity.

If my dentist told me I needed to pay particular attention to my right back teeth, and that I should begin brushing from right to left, that would certainly be possible with a little conscious effort and instruction from my brain. The specificity creates the difference between 'I need to change the way I brush my teeth from the way I'm currently doing it', to 'I need to start brushing from the right and work my way to the left.'

(My hiccup thing however, can't be changed in the same way. But it doesn't really affect my life too much and also isn't that relevant to what I'm explaining.)

You can see I'm heading towards the meaningful part of this explanation... so let's go there:

Normal Flo'

Normal Flo' Rida

Inline

Block

example of block and inline

Not normal flo'

Normal Flo' Rida

See the below example of buttons using display: inline vs display:inline-block

example of inline-block