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

HTML How to Make a Website Customizing Colors and Fonts Resize Text

Nothing will center. Footer nor nav

link of code; http://codepen.io/fishingjoker/pen/zGgVvO

I have done the same as the instructor. However, it seems like I have to fix something every time. Please help and explain so that i'll get better understanding.

Edit; Everything Is fixed, it was a minor problem with me forgetting to close my brackets.

4 Answers

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Ah sorry, I just realised you have nav css twice in your code.

I found the issue, you have not properly closed your css declaration for your h1 element.

h1 {
   font-family: 'Droid Serif', cursive;
   margin: 15px 0;
   font-size: 1.75em;
   line-height: 1.1em;
}

Hope this helps

Thank you so much sir! However, do you have any idea why my footer wont center?

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Yes I do.

Your footer will not centre because you also have not closed the css declaration for your unordered list (nav).

See below.

nav ul {
        list-style: none;
        margin: 0 10px;
        padding: 0;
}

Be very careful when you are coding to ensure you close everything you open. Syntax errors like this are one of the most common mistakes aside from perhaps spelling errors.

Keep up the good work

Argh! I feel so stupid now.

Well thank you so much for taking your time. Appreciate the community here alot! I will start paying better details to the syntax errors and spelling errors.

Thank you again for your time!

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Preben,

It seems you don't actually have any text align on your nav.

Try something like:

nav {
text-align: center;
}

I am pretty sure I do?

nav { 
    text-align: center;
    padding: 10px 0;
    margin: 20px 0 0;
}

Edit: I hate this formatting Edit: Formatting fixed by John Steer-Fowler

Dilshan De Zoysa
Dilshan De Zoysa
3,657 Points

Hi Preben, Having your css code control nav, nav ul, nav li can get you the desired result.

   nav { 
        text-align: center;
        /* with some padding and margin*/ }
   nav ul { 
        list-style: none;
        /* with some padding and margin*/ }
   nav li { display: inline-block; }