benjancewicz Posted August 15, 2007 Share Posted August 15, 2007 How do I write CSS to scale an image proportionally depending on window size?I've got some nice navigation that stays consistent no matter what the window size is: http://bmengini.com/beta/But I'd like the image to be resized with it.Any ideas? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 15, 2007 Share Posted August 15, 2007 You can use percentages for the image dimensions. Link to comment Share on other sites More sharing options...
benjancewicz Posted August 15, 2007 Author Share Posted August 15, 2007 You can use percentages for the image dimensions.I tried that, but the image wouldn't stay proportional. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 15, 2007 Share Posted August 15, 2007 If you only specify one of the dimensions, the other should resize proportionately. Link to comment Share on other sites More sharing options...
benjancewicz Posted August 17, 2007 Author Share Posted August 17, 2007 If you only specify one of the dimensions, the other should resize proportionately.Got it!!!! Take a look.http://bmengini.com/beta/EDIT: here's the solution I used: <img src="images/4831.jpg" width="100%"> Link to comment Share on other sites More sharing options...
Kingy Posted August 17, 2007 Share Posted August 17, 2007 Looking good, the image is rather large on this screen but I suppose regular users would find that ok. Link to comment Share on other sites More sharing options...
benjancewicz Posted August 17, 2007 Author Share Posted August 17, 2007 Looking good, the image is rather large on this screen but I suppose regular users would find that ok.What size are you using? And what would you suggest? Is there a way to set a maximum size? Link to comment Share on other sites More sharing options...
Kingy Posted August 17, 2007 Share Posted August 17, 2007 1280 by 1024 on my work computer.But the more I look at it it's not really bad. After all the point of your site is to show off designs so you want the photo to overpower the page right? Link to comment Share on other sites More sharing options...
benjancewicz Posted August 17, 2007 Author Share Posted August 17, 2007 After all the point of your site is to show off designs so you want the photo to overpower the page right? You got it. That's why everything is so thin. Link to comment Share on other sites More sharing options...
niche Posted May 17, 2011 Share Posted May 17, 2011 Thanks for the topic. It's just what I needed.Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.