웹 개발

DIV 안의 객체를 세로 가운데 정렬

노루아부지 2019. 8. 16. 23:48
<div style="width: 100px; height: 100px; display: table-cell; vertical-align: middle;">
      <input type="checkbox" id="aaa" name="aaa"/>
</div>

 

display: table-cell 속성은 div를 td 처럼 쓸 수 있게 해 주는 css이다.

이어서 vertical-align: middle을 써주면 가운데로 간다.

728x90

'웹 개발' 카테고리의 다른 글

jquery ui class  (0) 2019.08.16
web page performance  (0) 2019.08.16
script 태그의 async와 defer 속성  (0) 2019.08.16
html input text 입력 제한  (0) 2019.08.15
jqgrid에서 임의의 버튼에 jqgrid event 사용  (0) 2019.08.15
loading