Adjusting post width according to the image size

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/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)