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 trialEdward Hong
15,431 PointsThe inline styles are not working
The inline styles are not showing for body and h1 tags when I hit preview. Here's my code:
<!DOCTYPE html>
<html>
<head>
<title>Lake Tahoe</title>
</head>
<body style="background-color: orange;">
<header>
<span>Journey through the Sierra Nevada Mountains</span>
<h1 style="color: white;">Lake Tahoe, California</h1>
</header>
<p>
Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
</p>
<a href="#">Find out more</a>
</body>
</html>
Edward Hong
15,431 PointsHmm that's strange, I did copy all of it from Workspace here's the code again:
<!DOCTYPE html> <html> <head> <title>Lake Tahoe</title> </head> <body style="background-color: orange;"> <header> <span>Journey through the Sierra Nevada Mountains</span> <h1 style="color: white;">Lake Tahoe, California</h1> </header> <p> Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation. </p> <a href="#">Find out more</a> </body> </html>
davidlichtsteiner
7,314 PointsWell really strange it disappeared. Try only the body tag maybe that works
Ted Sumner
Courses Plus Student 17,967 Pointsformatted code. Select edit to review my changes and read the markdown Cheatsheet linked below.
2 Answers
Ted Sumner
Courses Plus Student 17,967 Pointstry clearing your cache on the browser.
kheiferfuller
8,635 Points^This also works.
Edward Hong
15,431 PointsThanks Ted, cleared cache and is working correctly now.
Ted Sumner
Courses Plus Student 17,967 PointsWhen there is an answer that solves your problem, please mark Best Answer. Also continue to upvote other good answers.
kheiferfuller
8,635 PointsThe inline style for the h1 looks fine but I don't see any for your body tag. Sometimes there are errors in the workspace itself. Have you tried saving it and reopening the workspace?
Saw Ted's edits: It looks like you answered the question correctly.
The other thing I could think of is that you probably don't need the ; at the end of your lines of code since it's just one value for each. This might be a small preferential choice but sometimes the workspace can be very specific
davidlichtsteiner
7,314 Pointsdavidlichtsteiner
7,314 PointsI don't see the body tag in your code. But the inline-style for the h1 one is working. As it is white and the background is also white u want see anything. Can you add the inline tag for the body element as well?