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 trialmm4
8,600 PointsStuck 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!
mm4
8,600 PointsHi 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
Jovanny Elias
16,204 PointsHtml 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.
Jovanny Elias
16,204 PointsHey try this out it worked for me.
<body>
<style>
h1{
Color:green;
}
</style>
<h1> nick Pettit </h1>
</body>
Orlando Vargas
2,220 PointsThis code does not work.
Example:
HTML=
<h1>Nick Pettit</h1>
```
CSS:
h1{
color: #000;
font-size: 14px;
}
Jovanny Elias
16,204 Pointstake 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.
mm4
8,600 PointsThanks - very helpful link!
Orlando Vargas
2,220 PointsThis code does not work.
Example:
HTML: <h1>Nick Pettit</h1>
CSS: h1{ color: #000; font-size: 14px; }
mm4
8,600 PointsJust 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 > ?
mm4
8,600 PointsAlso 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...
Jovanny Elias
16,204 PointsJovanny Elias
16,204 PointsWhen 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.