Vertical aligning in CSS
.container { display: block; text-align: center }
.container:before {
content: "";
width: 1px;
height: 100%;
}
.container .child,
.container:before {
display: inline-block;
vertical-align: middle;
}
Written by Ismael González
Related protips
2 Responses
or:
.yourDiv{
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center
}
over 1 year ago
·
Yeah sure, but i was talking about real-world solutions (cross-browser)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#