How to create column width in CSS that expands with large images yet stays a default size for normal

Posted by ChrisJF on Stack Overflow See other posts from Stack Overflow or by ChrisJF
Published on 2010-03-26T19:37:21Z Indexed on 2010/03/26 19:43 UTC
Read the original article Hit count: 313

Filed under:
|
|
|
|

I am creating an HTML5 web page with a one column layout. Basically, it is a forum thread with individual posts.

I have specified in my CSS file the column to be 600px wide and centered it in the window using margin: 0 auto;. However, some images that are in the individual posts are larger than 600px and spill out of the column.

I'd like to widen an individual post to fit the larger images. However, I want all the other posts to still be 600px wide.

Right now, I'm just using overflow:auto which will create a scroll bar, but this is less than ideal. Is this possible to have the an individual post width grow for larger content yet stay fixed for normal content? Is this possible using just pure CSS?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about css

Related posts about width