아래 케이스 1과 2를 비교해 보면
img의 기본 display 속성이 inline일 경우는 틈이 벌어질 수 있으며,
이 display속성을 display로 변경하면 틈 없이 이미지가 배치된다.
케이스 1
케이스 2
코드 확인
1. html
<section id="product_section">
<article id="product_article">
<img src="http://placehold.it/795x400" alt="">
<img src="http://placehold.it/795x400" alt="">
<img src="http://placehold.it/795x400" alt="">
</article>
<aside id="product_aside">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
<img src="http://placehold.it/170x200" alt="">
</aside>
</section>
2. css
#product_section > #product_article > img{
display: block;
}
참고 자료: 모던 웹 디자인을 위한 HTML5 + CSS3 입문, P.392
반응형
'코딩ㆍ개발 정보 > HTML5, CSS 기본' 카테고리의 다른 글
홈페이지나 모바일웹 수업에서 제일 중요한 것 (0) | 2020.11.01 |
---|---|
CSS로 background 화면 꽉 채우는 방법 (0) | 2020.09.22 |
자잘한 이미지를 뭉쳐서 스프라이트 이미지로 만들고 배경으로 지정하는 CSS (0) | 2020.09.19 |
table border=0 cellspacing=0 을 css로 만드는 방법 (0) | 2020.09.19 |
HTML에서 플랫UI 컬러 색상표 제공해주는 사이트 정보 (0) | 2020.09.18 |