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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -