Home › Forums › CSS › [Solved] Placement of background image › Reply To: [Solved] Placement of background image
May 20, 2014 at 4:53 am
#170686
Participant
You could try the ‘mobile first’ approach. Makes mobile styles the default, like this:
body.myatu_bgm_body {
background-image: url('http://karimphoto.com/wp-content/uploads/2014/05/20140419-_MG_2465.jpg') !important;background-position: center center !important;background-repeat: no-repeat !important;background-attachment: fixed !important;background-color: #fff !important;
background-color: #FFFFFF !important;
background-position: 50% center !important;
background-repeat: no-repeat !important;
background-size: contain;
}
@media (min-width:850px) {
body.myatu_bgm_body {
background-position: 81% center !important;
background-size: auto 85%;
}
}
One of the advantages of doing it like this, is that desktop browsers tend to be more up to date, and therefor more likely to support media-queries.