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 trialAmber McGuire
152 Pointstext not turning blue
for some reason my code is not changing the text to blue. I do not know what im doing wrong. it looks exactly like the one online but its just not working.
<style>
h1 { color: blue; }
</style> <h1> Nate </h1>
9 Answers
Steve Hunter
57,712 PointsSo it is, Ted! Thanks!!
So, that should look like:
<style>
h1 {
color: blue;
}
</style>
<h1>Steve Hunter</h1>
That should do it!
Steve.
Steve Hunter
57,712 PointsThat code looks fine. A few things:
- Have you saved your CSS file?
- Have you included the CSS file in the HTML using a link?
- Is there an h1 element in the HTML?
- I ran out.
Just a few things to look at! Steve.
Ted Sumner
Courses Plus Student 17,967 PointsAs I recall, that part has the css in the html. If so, did you put it before your h1?
Ted Sumner
Courses Plus Student 17,967 PointsAnother problem that I have seen is that it needs to be in the body tags for the quiz.
<body>
<style>
h1 {
color: blue;
}
</style>
<h1>Ted Sumner</h1>
</body>
Steve Hunter
57,712 PointsThankfully, the code challenge comes ready with the body elements pre-filled so that's one less thing to worry about!! :-)
Ted Sumner
Courses Plus Student 17,967 PointsTrue, but I helped someone who put the style before the body tag.
Steve Hunter
57,712 PointsAh yes - that wouldn't go well! I've made so many mistakes it's unbelievable! Still, it helps with the learning.
Christina Aryn Brown
1,415 PointsI'm having the same problem.
Ted Sumner
Courses Plus Student 17,967 PointsPlease post your code if you want help. The Markdown Cheatsheet tells you how to format it properly.
michaelmugo
3,971 PointsI realized sometimes you spell "colour" wrong without knowing! That fixed mine! should be color...
Steve Hunter
57,712 PointsAh yes, in all programming languages, I think, the American flavour (flavor) of colour is used, so you should default away from the English spelling and use color
`.
Same with centre - the American version is always used too, center
.
Marcus Watts
433 PointsI think it's a bug, because I have the same problem.
Ted Sumner
Courses Plus Student 17,967 PointsI have seen this problem many times and it has always been an error in the student's code, not a bug. Please post your code and we can help identify the problem with your code or figure out if it is really a bug. The Markdown Cheatsheet tells how to format the code quote.
Marcus Watts
433 PointsI have tried it with and without the body tags, and when I have put it another services version of a workspace it works fine.
Ted Sumner
Courses Plus Student 17,967 PointsThat fork works fine for me. I think it may be a browser cache issue. Try clearing your cache. There is also a way to refresh and override the cache, but I don't remember the exact key sequence. It is something like control-F5, but you will want to google it to be sure.
Marcus Watts
433 PointsThanks.
Yeah the problem was cache. I cleared it, and now it's fine.