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 How to Make a Website Beginning HTML and CSS Add Style to the Page

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

When I change the color from blue to red and save and preview again it does not reflect the change!

When I change the color from blue to red and save and preview again it does not reflect the change! Why is that?

7 Answers

There could be any number of things wrong. Try clearing your browser's cache (history) and then refresh the site. If that doesn't work, come back and post all of your code, wrap it within the code block as seen in the Markdown Cheatsheet. Don't forget to add a blank line in between the beginning of the code block and any text/code you put above it.

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

<!DOCTYPE html>

<html> <head> <meta charset="utf-8">
<title>Karthik | Utterly Useless</title> </head> <body> <header> <h1>Karthik</h1> <h2>Venky gave up on me</h2> </header> <section> <p>Gallery comes here</p> </section> <footer> <p>Ā© Karthik 2014.</p> </footer>

</body>

</html>

=================================================== When I refresh I am still getting the old header. I tried refreshing the page and clearing browsing history but still the same!

Is that your entire code? It feels as though there is quite a bit missing especially since the doctype is out of the code block. When you make code blocks, you should do them like this so that all of your code will appear:

'''

//PASTE CODE HERE

'''

You must have those blank lines before and after the code block and you must put the beginning and ending ''' mark on their own line. And I had to use single quotes for a placeholder but you should of course use 3 of the ` marks :)

If you want to, you can just edit your answer, and then make a comment letting me know that you did.

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

I did try that but I am still not able to refresh the content. What does code indentation has to do with issue though? Any change in my code should be reflected in my preview as soon as i change right?

Well, for starters, in your code that you pasted here, I see no CSS that would effect anything on your page. In fact, I see no CSS at all. Again, this is either because it didn't show up because of how it was formatted in your comment or because it is nonexistent. That is why I was asking you to edit your comment and just try to format your code blocks.

If you deleted all of your cache within the browser, refreshed the page, and the code still doesn't work, the problem is within your code.

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

<!DOCTYPE html> <html> <style> <head> <meta charset="utf-8">
<title>Karthik | Utterly Useless</title> </head> <body> <header> <a href="index.html"> <h1>Karthik</h1> <h2>Venky gave up on me</h2> </a> </header> <section> <p>Gallery comes here</p> </section> <footer> <p>Ā© Karthik 2014.</p> </footer> </body> </style>
</html>

That is the change I did

There is still no CSS either showing or actually on the page. And it's not formatted correctly. Your code should look like this:

<!DOCTYPE html>
<meta charset="utf-8">   
 <title>Karthik | Utterly Useless</title>

<body>
  <header>
    <a href="index.html">
     <h1>Karthik</h1>
     <h2>Venky gave up on me</h2>
    </a>
  </header>
  <section>
  <p>Gallery comes here</p>
  </section>
  <footer>
  <p>&copy; Karthik 2014.</p>
  </footer>
  </body>

Because that is all anyone on this forum can see of your code.

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

I am sorry to sound dumb but I still don't get the change intended. I am not able to preview any change I do on the code and not just the css style element. Not just one particular change but any change. I tried logging out and logging in again as well.

I am talking about the pasted code on this website strictly, not the code on your side. I can't see all of the code on your side because it is either not being pasted properly or not being formatted in your comment on this forum properly.

Karthik Nagarajan
Karthik Nagarajan
5,245 Points

I just found out what was the issue is. I had removed the html tag in the code while making changes. Thanks very much for ur time!

Haha I'm glad you figured it out!