How To Center Background Image Css Code Example


Example 1: center background css


background-position: center;

Example 2: css align background image center


body{ 
background-image: url('css.gif');
background-repeat: no-repeat;
background-position: center;
}

Example 3: move css background image


background-image: url('w3css.gif');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;

Example 4: css align backround image to the right


.right-align-background {
background-position: center right;
}

Example 5: background position in html


background-position: right top;

Example 6: css image background center horizontally in div


/*
div with
class="slot_image"
*/

.slot_image{
background: url(url) no-repeat center;
}

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