469,611 Members | 1,711 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

Safari isn't constraining proportions of my resized images

2
Alright, very new to this HTML business, but here goes.

I regularly scan and post my sketchbook pages on conceptart.org and usually scan em at about 525x380 pixels, never much bigger than that. I also want to be able to post them on my website's sketchblog that I've set up through blogger.com. My website. To keep the images from being too big and messing up my layout on the blog page I added the HTML,

img {max-width:400px;max-height:450px !important}

Keeps the images just small enough to stay on the page and I don't get a horizontal scroll bar. Works exactly like I want in Firefox but Safari isn't constraining the proportions of my images.
I'd just like to know if there was a simple way to tell Safari to contrain the proportions with HTML.
Again, here's my website and if you click sketchblog you can see what I'm workin at.

Also, the whole thing goes to bollocks in IE, but I imagine that's a post for another time. Unless someone has a simple, magic "make IE play nice" fix all. :)
Dec 15 '06 #1
5 1733
AricC
1,892 Expert 1GB
Why don't you try giving it a fixed width? This article has a fix for min-height/width issue.


HTH,
Aric
Dec 15 '06 #2
steven
143 100+
I imagine he doesn't want to use fixed width in the case the images are of a smaller size than the maximum stated dimensions he wants to allow.

Internet explorer doesn't support the max-width / max-height properties (surprise surprise), but you can use the underscore hack to get around that issue.

Expand|Select|Wrap|Line Numbers
  1. img {
  2.   max-width: 400px;
  3.   _width: 400px;
  4. }
This works because all standards compliant browsers see "_width" and ignore it because there's no such property "_width". Internet Exploder on the other hand, ignores any underscore at the start of a property and actually sees "width", which of course, it sets.

Not the best solution, but...

On the other hand, you could also create a containing div around your img and set the overflow to hidden. Again, not a great solution. I don't have konqueror or safari installed here, so I can't test for you.

PS, you have some nice sketches... some of them remind me of a style I really liked from some old 2000ad comics. Heh - I think some of it has to do with the redness of the noses. I like it. =)
Dec 15 '06 #3
steven
143 100+
Hah, now I look further, I realise I've seen your Sketch book on concept art! I remember liking the lines and had a good giggle at the self portraits of your facial expressions.

http://www.andyparrish.net/Images/Portfolio/Fisticuffs.jpg

That's you, right? Anyway - good luck with your new love affair with html.
Dec 15 '06 #4
Andy P
2
Hey man, many thanks for your replies. I'm pretty sure that I don't want to have to set a constant width for all the images if the proportions aren't gonna stay constrained. And I don't want the overflow getting hidden, so I imagine I'm gonna have to manually resize and re-upload these images for the blog. A pain, but I'm not savvy enough to go wrangling with browser specific HTML yet. I have a long long way to go before I can call my relationship with HTML a "love affair", hah.

Again, thanks for the help, and thanks for checkin out my stuff, I'm always pleasantly surprised at how much that CA sketchbook site gets around.
And, yeah, the jackass makin goofy faces is me. :)
Dec 16 '06 #5
AricC
1,892 Expert 1GB
Hah, now I look further, I realise I've seen your Sketch book on concept art! I remember liking the lines and had a good giggle at the self portraits of your facial expressions.

http://www.andyparrish.net/Images/Portfolio/Fisticuffs.jpg

That's you, right? Anyway - good luck with your new love affair with html.
That scetch reminds me of the Notre Dame mascot!
Dec 16 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.