Jump to content

Help needed with scaling a background image to fit browser/resolution


kanch33

Recommended Posts

Hello All!

 

Thanks for your help...

 

I am fairly new to dreamweaver and even newer to CSS.

 

Basically I have a fairly simple website that I'm working on... currently the background is an image thats 2000X1500 (widthxheight)

 

Now on my 24" mac screen it looks great and fits the browser window perfectly but on a smaller screen or on PCs it looks terrible.

 

I really need to find a way with HTML or CSS that I can adjust the size of the background image to the size of the users' browser window or resolution... I am happy to loose a bit off the right hand side (with the image aligned left) in order to maintain the aspect ratio

 

Help much appreciated thanks!

 

my html for the background is currently:

 

background-image: url(images/sitebackgroundweb.jpg);

background-repeat: no-repeat;

Can't he just apply the background-position declaration and align it?  If I remember correctly, if it's too big the excess won't be shown.

 

The downside would be that it loads the huge image regardless of screensize.

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.