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
Sherry Evans
3,377 Pointsconverting pixels to ems question.
When I convert font sizes from pixels to ems, is that in the html document or the css document or both? It looked like the example was in the html but I have font sizes in the css document as well
2 Answers
dalehudson
6,330 PointsHi Sherry,
If your linking to your css file, then you just need to to work from the css file.
If you place the style in your html page it could override any styles you have set in the css file.
Hope this helps
Erik McClintock
45,783 PointsSherry,
To help make your code more maintainable and semantically correct, you should keep all styling (i.e. font sizes) in external style sheets, i.e. your CSS file(s). Your HTML files are for Structure, your CSS files are for Presenation, and once you get to the point of adding in some JavaScript, that is for Behavior. Thus, keep all aspects related to each discipline in their respective files, and you'll live a much happier life as a designer/developer (as will any other designers or developers who work with you and might be adding to/editing your code).
Therefore, the answer to your question is: convert those sizes in your CSS file.
If, in the video you watched, you saw any inline styling (i.e. font size or color or anything like that in attributes inside your HTML elements), or if there were style tags opened up in the head of the document, it's likely to try and ease you into the idea of adding styling to elements before bringing in the concept of keeping things in external CSS files and linking those files in...but if you know that you should have a CSS file, know that that is where you want to keep all style information.
Hope that helps and wasn't too belabored!
Erik