the murmurous sea

CSS: inline-block 본문

#dev/개념정리

CSS: inline-block

lunacer 2020. 4. 4. 18:01

masonry layout 

<figure>
	<img src="image.jpg">
	<figcaption>image title</figcaption>
</figure>

 

When setting the masonry layout, <img> and <figcaption> are separated when the content overflows to the next column. 
To prevent this, 

the outer section <figure> that surrounds <img> and <figcaption> should have this value:

display: inline-block


"Compared to display: block, the major difference is that display: inline-block does not add a line-break after the element, so the element can sit next to other elements."

from:

https://www.w3schools.com/css/css_inline-block.asp

'#dev > 개념정리' 카테고리의 다른 글

Poptrox  (0) 2020.04.13
@-ms-viewport {width: device-width;}  (0) 2020.04.13
CSS: flexbox  (0) 2020.04.07
CSS: em vs. rem  (0) 2020.04.06
CSS: alignment  (0) 2020.04.04
Comments