Skip to content

Instantly share code, notes, and snippets.

@tehillim
Created July 30, 2015 06:03
Show Gist options
  • Select an option

  • Save tehillim/8ed57f6d549dc5a70d0f to your computer and use it in GitHub Desktop.

Select an option

Save tehillim/8ed57f6d549dc5a70d0f to your computer and use it in GitHub Desktop.
초간단 세로 정렬, css 상하 중간에 글씨 맞추기, 어렵게 생각하지 말고, table속성을 이용해보자.
<div class="arr"><div class="v">a</div></div>
<div class="arr"><div class="v">b</div></div>
<div class="arr"><div class="v">c</div></div>
<style>
div {
background: gray;
height: 200px;
width: 200px;
}
.arr {
display: inline-block;
vertical-align: middle;
text-align: center;
}
.v {
display: table-cell;
vertical-align: middle;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment