jnf555 Posted June 17, 2009 Share Posted June 17, 2009 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 More sharing options...
smerny Posted June 17, 2009 Share Posted June 17, 2009 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 More sharing options...
jnf555 Posted June 17, 2009 Author Share Posted June 17, 2009 thanks Link to comment Share on other sites More sharing options...
jnf555 Posted June 17, 2009 Author Share Posted June 17, 2009 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 More sharing options...
smerny Posted June 18, 2009 Share Posted June 18, 2009 look at the examples in my post on the format, basically just take out the "width:" and "height:" Link to comment Share on other sites More sharing options...
jnf555 Posted June 18, 2009 Author Share Posted June 18, 2009 <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 More sharing options...
smerny Posted June 18, 2009 Share Posted June 18, 2009 http://www.w3.org/TR/2002/WD-css3-backgrou...background-size Link to comment Share on other sites More sharing options...
jlhaslip Posted June 18, 2009 Share Posted June 18, 2009 *note*The background-size property is CSS 3 and may not be supported in your test Browser. Link to comment Share on other sites More sharing options...
jnf555 Posted June 18, 2009 Author Share Posted June 18, 2009 thanks the information on the link is very informative,i should be able to sort it from your repliesthanksjnf555 Link to comment Share on other sites More sharing options...
Ingolme Posted June 18, 2009 Share Posted June 18, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.