Align vertically and horizontally image inside figure
Easy and fast image alignment within the tag figure (or whatever you want).
HTML:
<figure>
<img src="path/to/image.jpg" alt="Image">
</figure>
CSS:
figure {
width: 400px;
height: 250px;
line-height: 250px;
text-align: center;
}
img {
vertical-align: middle;
}
Written by Fernando Soares
Related protips
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#