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

Sizing units for mobile

I've been following the latest track on how to build a basic website and i've realised that Nick uses fixed unites rather than relative units such as ems or % when using margins and padding for certain elements when designing for mobile first.

I was wondering if its okay to still use fixed pixels when sizing elements i.e pictures. Previous courses have suggested using percentages or work out the em value.

Just a general question is this best practise because previous videos like the responsive web design project suggested using these relative units for margins and padding or when designing for mobile first does this not matter.

6 Answers

Jonas Mørkeby - We try to do our best to work with posts as written and keep comments on grammar to a minimum as Treehouse students come from all over the world and have varying degrees of proficiency with English grammar.

> Or if you used a question mark maybe I would understand what the question was.

While question marks do help clarify when a sentence is a statement or a question in this case I believe it is clear without a question mark.

In this particular case, where a sentence begins with the phrase "Just a general question" it's clear to me that what follows in the sentence is going to be a question (and not a statement).

The post has been edited and now the sentence makes sense even without the question mark. I am not sure a question mark would have helped before.

If my memory serves me correctly, because I did that track a while back and was wondering the same thing. I think it's structured that way so beginners wouldn't get confused. There's other courses that focus more on relative units.

Hello.

I don't know if it is just me, but I am not sure what the question is...?

Using relative units is the best way of creating websites for handheld devices, this will make them more fluid.

I'm talking about the how to make a website project he used pixels to size elements and also margins and paddings if your on the project you would understand maybe

Yes maybe... Or if you used a question mark maybe I would understand what the question was. But I realize now that my help is not wanted here... Sorry for trying!

errr i just suggested if you were on the same project as me not sure why you seem offended at a suggestion ?

But I wouldn't know what to look for in the project to help you, because I still don't know what the question is? And maybe I know the answer without taking the course...

My suggestion to you in my first comment was to actually ask a question, but you don't seem to think that this is necessary to get an answer... So hopefully you will get the help you seek from someone who is on the project.

Tunde Adegoroye -

If you think about the way relative units work, they are always relative to a fixed unit. That fixed unit is often supplied by media queries. However building mobile first can help cut down on the need for media queries, in most cases you will still need some media queries.