CSS Tips to Prevent image from being to large

Sometime you have an image show up in your blog which is to large that causing problems with your WordPress theme. This is special common for WordPress blogs that have multiple authors, where some author don’t know how big the image they can make or to new bloggers who is not very familiar with CSS code.

Fixing this problem is absolutely easy with CSS hack. You only need to place following code in your stylesheet to set the maximum width for your image:


.postarea img {
max-width: 500px;
height: auto;
}

In the above code snippet, you have to replace postarea with whatever div ID or Class which is used in your theme for the content. And you can set the max-width properties to higher or lower to be suitable to your theme.

As you see, it’s absolutely simple to prevent image from being to large with just some CSS hacks. Just do it now for your blog. But please note that this hack may not work on some versions of IE.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Share/Save/Bookmark

Leave a Reply