Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Christopher Paccione
14,831 PointsBackground URL won't load on ipad or iphone
Hello Everyone,
I'm rather new here, and I've been enjoying my time so far, but I'm completely frustrated with a background image problem I'm having.
The image loads on all browsers via desktop or laptop, but it will not show on the ipad or iphone. I've tried many different variations with the media query, but no luck.
My website is chrispaccione.com Let me know if there is anything else I can provide to get a solution. Thank you!
<div id="heading">
<div class="container text-center">
<h1>Chris Paccione</h1>
<h4>Front-End Web Developer</h4>
</div>
</html>
</div>
#heading {
height: 400px;
padding: 20px 0;
background: url(../img/banner.png) no-repeat center center fixed;
-webkit-background-size: 2000px 1175px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
4 Answers

Christopher Warren
17,640 PointsFrom what I know, people mostly fix this issue via jquery. However I'm sure there would be a css solution. I would probably go the media query route and simply change the fixed position to something like relative and just make it a normal navigation bar on mobiles. (More space for the content - since we lack space on iphones)

Christopher Warren
17,640 PointsAh! Safari on ios doesn't support position: fixed; You will need to change that to something else.

Ernest Grzybowski
Treehouse Project ReviewerI second this!

Christopher Paccione
14,831 PointsThanks for the suggestions and help!
This is the current state of my CSS, can I override "center fixed" with a media query?
#heading {
display: block;
width: 100%;
height: 400px;
padding: 20px 0;
background: url(../img/banner.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Ernest Grzybowski
Treehouse Project ReviewerBefore we go further, can you let us know if simply including the single quotes around the url worked? What about commenting out the code that I mentioned as well?

Christopher Paccione
14,831 PointsNo luck with the quotes....

Ernest Grzybowski
Treehouse Project ReviewerWhat about the other suggestion I made?

Ernest Grzybowski
Treehouse Project ReviewerConfirmed that this works on my Android device, but not on my iOS device. What happens when you remove this in #heading
:
-webkit-background-size: 2000px 1175px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

Christopher Paccione
14,831 PointsUnfortunately that's a negative as well...
Ernest Grzybowski
Treehouse Project ReviewerErnest Grzybowski
Treehouse Project ReviewerCan you post the link of your website or the full code?