CSS background image won't scale -


i'm trying learn html , css. right i'm trying make background image fill browser window no matter size. i've googled 100 times , every page pretty says same thing. copied code , isn't working me. when set browser smaller size, background image repeats itself. don't want want fill window. here's css.

html { background-image:url(background.jpg); background-size: 100%; background-image: no-repeat-y; } 

before did 100%, tried using cover instead , didn't work either. image fullscreen when window maximized when resize image repeat.

to scale, css want scale needs inside container itself, namely body inside html container; try this:

html {   width: 100%;   height: 100%;   margin: 0;   padding: 0; }  body {   background-image:url(background.jpg);   background-size: 100% 100%;   background-repeat: no-repeat-y; } 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -