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

Copyright Text and Border Line

I just can't seem to get the copyright text and border line in the center of the page. I've re-watched the video a few times and I still can't see what I'm doing wrong. Can someone help me with this? This is the code I have.

#copyright {
  border-top: 8px solid #2a0400;
  padding: 15px 0px;
  margin: 15px 0px;
  text-align: center;
}

Since your information is inside a <div> tag and copyright is an id (id="copyright"), you might want to add a pound symbol (#) in front of the copyright in your code. This is how you call an id. If it were a class you could use a period to call it. Try this

copyright {

border-top: 8px solid #2a0400; padding: 15px 0px; margin: 15px 0px; text-align: center; }

Apparently you are trying that! It formats the text and removes the pound symbols, in this forum. Sorry for the miscommunication.

Nick Pettit
Nick Pettit
Treehouse Teacher

Hi Phil Hemmings,

Can you post a link to the specific video you're referring to? I should be able to help you pretty quickly after that. :)

Hi Nick,

It was under "Build A Simple Website" Styling Content, "Finish The CSS" Video 9min 16sec!

3 Answers

Hi Phil, looking just at this CSS you must have text align:center on the parent element of the #copyright element like this:

<div class="parent">
    <div id="copyright">
        Text here
    </div>
</div>

.parent{
    text-align: center;
}

#copyright {
  border-top: 8px solid #2a0400;
  padding: 15px 0px;
  margin: 15px auto;
  text-align: left;
}

You will also notice that the margin must have "auto" set for the left / right parts too, as it would need to be an automatic width from the left and the right. I hope this helps you.

You would also need to set text-align: left on the #copyright container if you do not want that centered too as it would inherit from the .parent element the center aligned text.

I'm sorry Jonathan, this didn't work either. Thanks!

Apologies, this was just a code example not the answer.

Waqar Mohammad
seal-mask
.a{fill-rule:evenodd;}techdegree
Waqar Mohammad
iOS Development Techdegree Student 9,914 Points

Hi Phil,

You may have an issue on your code in the index page as you may have put it under the wrong class. Can you post the code to the footer please?

Thanks

It's been two days and if you're still stuck here's a hint:

Your padding is wrong =)