I am building a theme for a comic site. It seems some images are bigger than the post size. I need to resize the images according to the Original Image size. Can I achieve this through CSS? It doesn't matter if it extends the screen-size and scrolling window is shown.
1 Answer
Markup:
<div class="post">
<div class="thumbnail">
<img class="thumb" src="http://placehold.it/950x450/" />
</div>
</div>
CSS:
.post {
width: 500px;
}
.post img.thumb {
width: 100%; /* fill available space of parent and keep aspect ratio */
}
Fiddle: http://jsfiddle.net/