Horizontal & vertical align with dynamic height
Using block level elements such as div's to structure your markup, you can use css display:table && display:table-cell to make the markup behave like a table. This will allow you to vertically align images in a way that allows you to have a dynamic height.
Check out the following link for browser support
Browser Support
http://caniuse.com/#feat=css-table
Written by Ian Crowther
Related protips
4 Responses
Hi! Can you make an example, to experiment with, please?
over 1 year ago
·
@sadfuzzy done
over 1 year ago
·
There's a super-awesome method using inline-block and a :before element that allows vertical alignment of an unknown height in its container with no extra markup, too. More at: http://css-tricks.com/centering-in-the-unknown/ .
over 1 year ago
·
Thanks!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Related Tags
#css
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#