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! While you're at it, check out some resources Treehouse students have shared here.

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

CSS

How to fix horizontal scrolling in mobile view?

The website works fine in desktop view but as soon as I change into mobile viewport (in chrome). I get a scrolling bar at the bottom of the page

Check whether your images are bigger or if you have fixed width or some elements to large pixels like 500 or 1000. You can change it to % value so that it fits the screen automatically.

1 Answer

Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

I agree with Nijesh, check your photos and make sure they are set to a % for the width (like - width: 100%;) so that the image changes to fit the screen. You might have to make some other changes when in the mobile view to have to correct portion of the image showing if it is a background image: background-repeat: no-repeat; background-size: cover;