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

Mobile Display Question

Hi I have this site

www.punchdartsclassic.co.uk

and although not responsive I would like it load in the middle of the viewport and scaled to fit a mobile device when it loads.

I am using

meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

But it just looks odd on mobile devices

Can anyone help please.

G

5 Answers

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Graham,

The mobile browser will scale it to the device width, but since you have #container set to a fixed width of 960px, the layout will still "slide" in and out of the viewport.

Create a breakpoint for it, or adjust it so that the layout is fluid for better results.

Hope this helps :)

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

@Graham Your viewport is fine. I think your classics.png is too wide.

Thanks to both of you for this it is going to get the responsive work over at the weekend - as long as I can get my head around bootstrap today.

Thanks again chaps.

G

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hey Graham,

No need for Bootstrap. You can do something quick & simple, like this: http://codepen.io/Treehouse/pen/yFquh

This is a quick example I whipped up using your code –– hope you don't mind :)

Check it out full screen on your mobile device: http://codepen.io/Treehouse/full/yFquh

Guil

Hi Guil

Wow thanks for that, and no I don't mind at all.

Really appreciated.

G