Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Which unit for line width in responsive layouts.

I have a question i never really asked myself. normally i use em as the unit of choice for responsive projects but somehow i never challenged myself about the unit for the line width. if you normally have defined a line like that

    border-top: 1px dotted black;

you tend to forget that the width is also set in pixel even if it is just one single pixel and not a really a layout element altering the flow. but would it be better to change it to em too? for the sake of consistency? best regards r.

1 Answer

"If 0.1em computes to a value that is less than 1px, it may be ignored depending on how the browser chooses to round values. Perhaps it's the case that Firefox and IE round numbers, whereas Chrome floors them. You should probably just use a value of 1px instead of using em."