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 bad is my code

hi guys i have a problem. i know html & css but i am not good putting those together, so i have decided to learn the right way of making web pages semantically in next 7 days and i need your help.

i will be keep posting my codes from today and please help me by correcting me.

Day 1

http://cdpn.io/zhguf

check the above link. i am unable to find how the header got that height even though i haven't added any

2 Answers

Maithreya,

If you tell your .main-header class to have a position:relative;, instead of position:fixed;, you will notice that your header bar changes what is perceived as "height".

As addition, instead of using relative for navigation and logo to center them vertically, you can instead define a header height e.g. 60px and add line-height: 60px to it, this will center elements vertically, as long as you only have one line of text / elements.

In terms of semantics, I'm not sure how correct this is, but I would actually place header inside of container maybe? so container would be one that stretches across whole page and header would be one that has a width of 960px.