Static background in HTML5
Hello i whant to create a static background for my site , using HTML5 . This i found on dev :
and this works for scroll , but i want the same for ctrl+scroll
how can i get that ? ctrl+scroll makes a matrix of bckg-pictures , when i use ctrl+ scroll .I thought that the only way , is to get/create a bigger picture , but hope there is something more.
Nice question, today I learned about the background-size property.
I think "background-size: cover;" might be what you're looking for.
Comments on this post
I am now trying to add this background png to my html tag (some website suggested this over the body tag). The height of the image is 1000x1052. I am trying to make the background image scale to the size of the screen, so its like a liquid layout.
July 10th, 2013, 11:29 PM
Thank you very much . This is the thing that i was looking for.
July 12th, 2013, 01:37 PM
Add this to your head or stylesheet. The filter and ms-filter entries are the part that fix the "cover" method for IE.
Originally Posted by abramsalfie
background: url(image_name.png) no-repeat center center fixed;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image_name.png', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image_name.png', sizingMethod='scale')";