css - Make background image responsive -


i want make background image responsive both in width in height can run in mobile.

i have used

.your_background_class_name {     width: 100%;     height:auto;     top: 0px;     left: 0px;     z-index: -1;     position: absolute;  } 

but works in width not in height. changes should make work?

html {    background: url(https://encrypted-tbn2.gstatic.com/images?q=tbn:and9gcsvctt0i--skokqvfuvt-i4et6vq5ve7lxpkly9stelcwlkh1ps) no-repeat center center fixed;    -webkit-background-size: cover;   -moz-background-size: cover;   -o-background-size: cover;   background-size: cover; } 

know more background-size here.

see demo


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -