Jump to content

Size Of Background Img


jnf555

Recommended Posts

hi i am using an image as my body background, but need to change the size, can anyone show me how.<html><head><style type="text/css">body{ background-image: url(fade.png); background-repeat: no-repeat;}</style></head><body>this is background</body></html>cheersjnf555

Link to comment
Share on other sites

background-size: width height;examples:so if you wanted it to be 15px wide by 25px high...background_size: 15px 25px;and if you wanted it to fit twice horizontally and keep the aspect ratio...background-size: 50% auto;

Link to comment
Share on other sites

i think i am missing something here it dosent alter the sizewhat have i missed out?<html><head><style type="text/css">body{ background-image: url(fade.png); background-repeat: no-repeat; background-size: width:1000px height:900px;}</style></head><body>this is background</body></html>

Link to comment
Share on other sites

<html><head><style type="text/css">body{ background-image: url(fade.png); background-repeat: no-repeat; background-size: 900px 600px;}</style></head><body>this is background</body></html>sorry,it still dosent alter size, if i do smaller or larger than source size

Link to comment
Share on other sites

I don't think background-size is supported by any of the main browsers these days. Aside from opacity, I don't recommend using CSS3 properties yet.If you want to change the size of the background, you'll have to change the size of the image file, or use an image tag and place it behind the rest of the document.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...