inline-block, inline, inline-flex
block, flex
none
예외
a, span 엘리먼트: display - inline(기본 값)
img 엘리먼트: display- inline-block(기본 값)
inline 요소에는 width, height, margin, padding 속성이 제대로 적용되지 않는다.
HTML
<table border="1">
<thead>
<tr>
<th>display</th>
<th>너비</th>
<th>높이</th>
<th>한줄 혼자 사용</th>
</tr>
</thead>
<tbody>
<tr>
<th>block</th>
<td>지정되지 않으면, 최대한 넓어진다.</td>
<td>지정되지 않으면,최소한으로 줄어든다.</td>
<td>혼자 사용(세로로 나열)</td>
</tr>
<tr>
<th>inline-block</th>
<td>지정되지 않으면, 최소한으로 좁아진다.</td>
<td>지정되지 않으면, 최소한으로 줄어든다.</td>
<td>최대한 여럿이 사용(가로로 나열)</td>
</tr>
</tbody>
</table>
<ul>
<li>div, section, nav, article의 display 속성 기본값은 'block'이다.</li>
<li>div, section, nav, article의 width 속성 기본값은 'auto'이다.</li>
<li>div, section, nav, article의 height 속성 기본값은 'auto'이다.</li>
</ul>
CSS
table {
border-collapse: collapse;
}
th,
td {
padding: 10px;
font-size: 1.5rem;
}
