Categories: Tips & Tricks

Sick of images being to large for the content area?

Have you ever uploaded an image that might have been a tad bigger than the width of your content area? I know I have! So here is a little CSS fix to handle these situations.

Resize those large images using CSS

.post img {
 max-width: 600px;
 height: auto;
 }

That’s it, really simple huh. Just make sure that you change the .post to the correct body class(which starts with a “.“) or body ID(which starts with a “#“).

Would you like a quick explanation?
The CSS is just telling any image inside the class of .post to not be more than 600px wide. By the way make sure you change it to fit the dimension of your content width. And the height attribute is set to auto to automatically change the height to match the new width. 🙂

Web Master

Hi, I am Miguel, I bought this site in 2009. So I now run or manage the site. Please visit my new website or follow me on twitter @W3i.

View Comments

  • Hi there, found you through a re-tweet from Lyndi. I love this fix but I am very code-illiterate. Also, attempting to learn XHTML instead of HTML. Where would this go, in the Stylesheet.php or would it go in the post where the image is

    It seems like it would go in the style sheet as an overall rule, right?

  • I was searching the internet trying to find an easy way to do this. In the past I was loading and reloading my images to make them fit properly. I have bookmarked your site and will check it out more in the future.
    .-= Beavisthecat´s last blog ..Happy Labor Day! =-.

Recent Posts

Adsense Pro Ultimate – Top Selling CTR Worpress Theme Review

Classic CTR Themes For WordPress have made it pretty easy to build informational websites using…

4 hours ago

How to Incorporate a Website into Your Website Marketing Efforts

In today's techno-centric culture, you simply must have a business website, no matter how small…

8 hours ago

WordPress Tips for Photographers

Photography is the art of capturing naturalistic images with the help of photographic cameras. It…

20 hours ago

10 Best Digital Marketing Plugins for WordPress 2022

Have you opened up a new website or a business and want to drive more…

1 day ago

Configure your WordPress Site for SEO

WordPress has evolved greatly from its origin as a powerful blogging platform to an effective…

2 days ago

In the yеar 2002, Mіcrоѕoft саmе uр wіth a whоlе new рlаtfоrm for developing арplicаtiоnѕ.

Busіnеsѕеs аnd orgаnіzatіоns аll аrоund the wоrld arе loоking fоr а ѕоlutiоn thаt wоuld prоvе…

2 days ago