...

View Full Version : large images



Repatilian
08-27-2010, 06:21 AM
Hey is there a way the display an image on a website that's wider than like 1280 and have the browser adjust it without having to scroll right or up and down? For instance in a container.

Doctor_Varney
08-27-2010, 06:40 AM
What do you mean, have the browser 'adjust it'? Adjust by what means? Scale or position?

To scale an image, you can use img {height:--px; width:--px;} in your CSS or <img height="-" width="-"> in your markup.

That's for specific sizes, in which case you would usually just resize your image in Photoshop etc. You can also use percentage scaling so instead of using the px measurement, you can make the image a certain % of the screen size or, in your case, a % of the container.

Does that help at all?

Dr. V

Repatilian
08-27-2010, 08:07 AM
no i mean a picture that's say 1700 pixels wide, then when displayed on a 1280x1024 monitor or laptop you don't have to scroll right to see it all. could i just center it?

teedoff
08-27-2010, 03:47 PM
I think you would have to resize the image to a smaller res, make sure its in a format that doesnt degrade when it is stretched then do what Dr said...set width and height to 100%. so whatever screen resolution its in it will fit the entire screen. Provided its not in a div container that will constrain it.

Doctor_Varney
08-27-2010, 05:12 PM
That's right. If you set both it's width and height dimensions to 100%, it should stretch. You can position it center with margin:0 auto;.

It would be more helpful to us (and in turn to you) if you could go into more detail about the purpose of this image. Assuming it's a background, there will be some div background styling attributes to learn - and even then, we don't know if you're using tables or CSS for positioning in your site.

Dr. V

teedoff
08-27-2010, 05:54 PM
Dr Varney...off topic, but are you also over at daniweb forums? there is a Varnius there. lol

Doctor_Varney
08-27-2010, 06:04 PM
I'm either Dr_ Varney or simply Varney on all forums I use. I've never used the name 'Varnius'.

Dr. V

Doctor_Varney
08-27-2010, 07:33 PM
Repatilian, I'm struggling with a similar issue at the moment, came across something and wondered if this article (http://css-tricks.com/how-to-resizeable-background-image/) would be of any use to you?

Regards

Dr. V

Repatilian
08-28-2010, 04:56 AM
i'm using css. i have one picture that has my logo and background in it. that third attempt on the website looks like the best. here's a good site i found in the comments. http://www.younic.de/scaling-body-background-images-with-pure-css.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum