Link to home
Start Free TrialLog in
Avatar of John Carney
John CarneyFlag for United States of America

asked on

Re-setting a css style when a mobile phone user switches from vertical to horizontal view

I have a webpage with a background image that looks fine when I hold my phone horizontally. Here's the code for the background image:
body {background:url(images/CoupleInSilhouette.jpg) no-repeat;
background-attachment:fixed; 
background-position:center; margin: 0 auto;
background-size: cover
}

Open in new window

But since the background-position is set to center, when I view the page holding the phone vertically, the left part of the image is hidden from view. Is there code that will move the position of the background to the right by a specified number of pixels? here's the page in question: www.dijitalrealm.com/JCMusic/ManOfMyWords.html

Thanks,
John
ASKER CERTIFIED SOLUTION
Avatar of Kim Walker
Kim Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Carney

ASKER

Thanks, Kim, that works great. :- )