Jump to content

Size Of Background Img


jnf555
 Share

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;

Edited by smerny
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...