Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

Stuck on challenge task 2 of 3

I have the following:

<body>
  <style>
    h1 {
      text:Nick Pettit
    }
  </style>
</body>

I don't understand why this doesn't work. What I'm doing is choosing a property and its value (well, text isn't a property so I need help on that front too...) Any advice would be greatly appreciated!

When your writing code add 4 in a new line and after you end the code add another 4 in a new line after your code. This way when you post your code it's clear and will help everyone understand your problem a lot easier.

Hi Jovanny,

Thanks for the quick response! I did try that but I think I'm doing something wrong. Do you have another example I can refer to?

Edit: Ahh, 4 spaces before each new line of code! Got it, thanks!

7 Answers

Html is used to simply get your content on the page for example adding your text, links, pictures, tables and other elements. Css controls how all your html looks and is laid out. Css makes your html look pretty basically. There is a way you can add it together it's called inline however this is not recommended as it can get messy. Adding it separate from your html will allow you to easily find and modify your elements like the h1 tags.

Hey try this out it worked for me.

<body>
<style>
h1{
Color:green;
}
</style>
<h1> nick Pettit </h1>
</body>
Orlando Vargas
Orlando Vargas
2,220 Points

This code does not work.

Example:

HTML=

            <h1>Nick Pettit</h1>
            ``` 

CSS:

h1{
color: #000;
font-size: 14px;
}

take a look at this post it's a different topic but in it another guy has a picture and explain it a little better than I did. It shows you how to post the code. I would post the picture but for some reason when I used my iphone it won't let me add any pictures.

https://teamtreehouse.com/forum/stage-7-help

Thanks - very helpful link!

Orlando Vargas
Orlando Vargas
2,220 Points

This code does not work.

Example:

HTML: <h1>Nick Pettit</h1>

CSS: h1{ color: #000; font-size: 14px; }

Just so I understand, HTML controls text and CSS controls everything else? That means every time I want to modify attributes of h1 I have to do it separately from < h1 > nick Pettit < / h1 > ?

Also how did you guys get your code to show up as code in the black boxes, and not as what would show up on the website itself? I've been having trouble trying to figure that out...