yeji

display: table, table-cell / table-layout : fixed 본문

CSS

display: table, table-cell / table-layout : fixed

yeji717 2020. 5. 10. 13:53

 

 

부모에게 display : table; 하고 width:100%; table-layout:fixed;

자식에게 display : table-cell; 

 

이렇게 해주고 자식요소에게 width값을 주면 자식요소의 숫자만큼 동일하게 넓이가 나온다!..

2개면 50%

3개면 33.3333%

4개면 25%

 

'CSS' 카테고리의 다른 글

IR기법  (0) 2021.02.23
CSS 가로 정렬? inline-block과 float중 어떤 것을 써야 할까?  (0) 2021.02.09
Flexbox  (0) 2021.01.30
heigth:100%  (0) 2020.06.09
text-align : center / margin : 0 auto  (0) 2020.05.09
Comments