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

HTML How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

mukul lohia
mukul lohia
985 Points

background color is not changing

<!DOCTYPE html> <html> <head> <meta charset="utf-8">

<title>MUKUL LOHIA|ENTREPRENEUR</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href"css/main.css">

</head>

<body> <header> <a href="untitled.html" <h1>MUKUL LOHIA </h1> <h2>ENTREPRENEUR</h2> </a> <nav> <ol> <li><a href="untitled.html">portfolio</a></li> <li><a href="about.html">about</a></li> <li><a href="contact.html">contact</a></li></ol></nav> </header>

<section> <ul> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>natural is good</p> </a>

      </li>
       <li>
          <a href="img/numbers-02.jpg">
          <img src="img/numbers-02.jpg" alt="">
       <p>natural is good</p>
                </a>

      </li>
       <li>
          <a href="img/numbers-06.jpg">
          <img src="img/numbers-06.jpg" alt="">
       <p>natural is good</p>
                </a>

      </li>
       <li>
          <a href="img/numbers-09.jpg">
          <img src="img/numbers-09.jpg" alt="">
       <p>natural is good</p>
                </a>

      </li>
       <li>
          <a href="img/numbers-12.jpg">
          <img src="img/numbers-12.jpg" alt="">
       <p>natural is good</p>
                </a>

      </li>

    </ul>
</section>

<footer> <p>Ā© 2016mukul lohia.</p>

</footer> </body>

</html> pls tell me how can i change my background color

3 Answers

Hi, here are a few examples along with descriptions.

body{
    background-color: ######;
}

As stated, stylesheets are most common when it comes for editing your look and feel to a website. I love using this method due to it's space saving ability in documents. Rather than taking up space you can just have everything neatly put together. I personally use this method for my full website styles.

Inline Styles

<!DOCTYPE html>
<html>
  <body>
     <style>
        body{
            background-color: ######;
        } 
     </style>

  </body>
</html>

<style></style> tags are really useful for quick page stylesheets. Definitely not recommended but I personally use these if I have a user account that wants a certain colour scheme on their profile page.

Element Styles

<body id="id" style="background-color: ######;"></body>

These are used to add styles directly in the element tag. I personally use these for quick styling that doesn't need to be included in the main stylesheet.

Extra Learning

If you want to learn a bit more about CSS3 then try and using either the Treehouse CSS3 course which you should learn if your on the Web Development track. Or if you want to catch a gist of CSS3 go to http://www.w3schools.com/css/css3_intro.asp

Althought I highly recommend continuing with Treehouse and learning the CSS3 they do a great job at explaining.

Ash Scott
Ash Scott
435 Points

I answered this issue in another post :)

You have an = symbol missing in your css import:

<link rel="stylesheet" href"css/main.css">
<link rel="stylesheet" href="css/main.css">

Second one is the correct one :D

mukul lohia
mukul lohia
985 Points

thanx for clearing my doubt..