Responsive Background Image In Html Css Code Example


Example 1: make a background image responsive css


html {
min-height: 100%;
background-image: url(image.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}

Example 2: background image size css


#example1 {
background: url(mountain.jpg);
background-repeat: no-repeat;
background-size: auto;
}

#example2 {
background: url(mountain.jpg);
background-repeat: no-repeat;
background-size: 300px 100px;
}

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable