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 CSS Selectors Going Further with Attribute Selectors and Pseudo-Classes :only-child and :empty

Richard Walton
Richard Walton
10,861 Points

Different from video?

I understand the lesson, but when I typed in the h1 title above the list, my title justified over to left, while the video was centered? everything else worked and I understood the lesson but it is driving me crazy? I added my h1 just like guil. I think my version of the lesson files are different? I fixed it by centering it in the inline styles provided to ease my mind, but i want to understand if i did something to cause it??

Hi Richard,

I answered a more recent question about this issue here, https://teamtreehouse.com/forum/why-does-my-h1-appear-on-the-left-of-the-browser where I gave a possible explanation.

1 Answer

Mark VonGyer
Mark VonGyer
21,239 Points

Possible issues:

1) The teacher placed the <h1> tag inside another container. This container is set to set to display central.

2) In your CSS maybe you have not correctly closed a selector which adjusts the text to display central.

You could run your code through the CSS validator on W3C, but it's best for you to find the typo yourself at early stages of learning.

Richard Walton
Richard Walton
10,861 Points

Thanks mark I really appreciate you taking time to respond.

I moved on to the next lessons, but went back to the workspace. For clarification during the lesson Guil typed in the h1 title above the list (minute 1:25) to show it changing the relationship between the body tag and the list (child/sibling). All the code typed is exactly as he typed (checked thoroughly many times?). He had internal styling in the code when opened, but on the video could not see his full styling. He typed the title and it was centered. I did the same and it was left justified. I would have love to think it was something I did , but it just doesn't seem to be there?

To address your points: 1)He made no adjustments to the title's style during video so thats why I suspect there may have been a difference in his original compared to mine. 2) there was nothing in the style-sheet when opened. All styles added there were directed at the li tag and all performed as expected. in the end, out of frustration, I added to the internal style-sheet that was already in the index file ( h1 {text-align: center; } ) to make it look like his.

As you suggested I ran it through the validator and it checked out as html5 fine. It wasn't the main point of lesson, but I really hate missing an opportunity to learn by correcting my mistakes, if I made them. It seems to me it had to be something missing in the original files I received which I corrected?? oh well?

Thanks again for your input. :)