[personal profile] tropicsbear posting in [community profile] style_system
Is it possible to set a maximum image width for your layout in your CSS? Sometimes some of my DW friends post huge images that take forever to load.

Thanks in advance for any help!

Date: 2011-11-02 05:55 am (UTC)
musyc: A kitten sitting on an open book (Cats: Kitten on books)
From: [personal profile] musyc
I use this:

.entry-content img { max-width: 500px; }

Change to whatever number works best for you.

Date: 2011-11-02 11:53 pm (UTC)
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)
From: [personal profile] matgb
I use

.entry-content img { max-width: 99%; }

for mine, then it scales to whatever monitor size I'm on nicely and can't overflow. Rather nifty little trick.

Just checked, I'm not using .entry-content, I'm using .contents, but don't think it should make any difference.

Date: 2011-11-02 06:32 am (UTC)
foxfirefey: A wee rat holds a paw to its mouth. Oh, the shock! (myword)
From: [personal profile] foxfirefey
Hrm, if they're taking forever to load, them chances are the images is big in SIZE, not just dimension, and it'll take forever to load no matter what you do with CSS--although [personal profile] musyc's suggestion will definitely keep the width down!

Date: 2011-11-02 11:45 am (UTC)
From: [personal profile] lilmoka
*butts in*

Your icon is the most adorable thing ever!

Date: 2011-11-02 05:16 pm (UTC)
musyc: Silver flute resting diagonally across sheet music (Default)
From: [personal profile] musyc
Ooooh, good point. Few people on my lists ever post photography or whatnot, and those that do are very good about cuts, so I didn't even think about filesize. My concern is always keeping the images from busting out my layout boundaries. :)

Profile

Dreamwidth style system discussion

April 2025

S M T W T F S
  12345
6 78910 1112
13 141516171819
2021 2223242526
27282930   

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 30th, 2025 02:58 am
Powered by Dreamwidth Studios