Background Properties   CSS


Summary

Background properties


element {
background-image: url('');
background-position: 50% center;
background-size: cover;
background-repeat: no-repeat;

/* same as */
background: url('') 50% center / cover no-repeat;
}

background-position: 50% center; // x-pos y-pos, or one keyword 'center'
background-size: cover; // Resize the background image to cover the entire container


Result



            

References


Tags

#background  #center  #cover 


[ Edit (Author only) ]