Innovation Cloud Step 3 Problem w/ Background Color


#1



I am having trouble with (.main .container { background-color: white;}) I've tried a few different things, but I can't fill the area with white. There is usually a gray frame or two gray bars above and below the white.


.main {
  background-color: white;
}

.main .container {
	margin: auto;
  background-color: white;
}

.main img {
  float: left;
  margin-right: 50px;
  margin-top: 40px;
}


#2

I don't understand which part you want white and its not white ?

Please paste in your HTML, CSS code as well as a screen shot of what you are seeing so I get a better picture


#3

<!DOCTYPE html>
<html>
  <head>
    <title>Innovation Cloud</title>
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,100' rel='stylesheet' type='text/css'>
    <link rel='stylesheet' href='style.css'/>
  </head>
  <body>
    <div class="header">
      <div class="container">
        <h1>Innovation Cloud</h1>
        <p>Connect your ideas globally</p>
        <a class="btn" href="#">Learn More</a>
        
      </div>
    </div>

    <div class="nav">
      <div class="container">
        <ul>
          <li>Register</li>
          <li>Schedule</li>
          <li>Sponsors</li>
          <li>About</li>
          <li>Contact</li>
        </ul>
      </div>
    </div>

    <div class="main">
      <div class="container">
        <img src="https://s3.amazonaws.com/codecademy-content/projects/innovation-cloud/cloud.svg" alt="blue-colored background image of people sitting in a lounge" height="128" width="196"/>
        <h2>The Innovation Cloud Conference</h2>
        <p>Connect with the best minds across a wide range of industries to share ideas and brainstorm new solutions to challenging problems.</p>
        <p>Hear industry leaders talk about what worked (and what didn't) so that you can save time on your most challenging projects.</p>
        <p>Learn about the latest research and technologies that you can use immediately to invent the future.</p>
      </div>
    </div>
    
    <div class="jumbotron">
      <div class="container">
    	<h2>Stay Connected</h2>
    	<p>Receive weekly insights from industry insiders.</p>
    	<a class="btn" href="#">Join</a>
      </div>  
    </div>
    
    <div class="footer">
      <div class="container">
        <p>&copy; Innovation Cloud Conference</p>
      </div>
    </div>
  </body>
</html>

html, body {
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Roboto', sans-serif;
	font-weight: 100;
}

.container {
	margin: 0 auto;
	max-width: 940px; 
	padding: 0 10px; 
}

.header {
  height: 800px;
  text-align: center; 
  text-transform: uppercase;
  background-image: url(https://s3.amazonaws.com/codecademy-content/projects/innovation-cloud/bg.jpg);
}

.header .container {
	position: relative;
	top: 200px;
}

.header h1 {
	font-size: 80px;
	line-height: 100px; 
	margin-top: 0;
	margin-bottom: 80px;
  color: white;
}

@media (min-width:850px) {
	.header h1 {
		font-size: 120px;
	}
}

.header p {
	font-weight: 500;
	letter-spacing: 8px;
	margin-bottom: 40px;
	margin-top: 0;
  color: white;
}

.btn {
  background-color: black;
  text-decoration: none;
  padding: 10px 24px;
  color: white;
  text-transform: none;
}

.btn:hover {
	background: #117bff;
	cursor: pointer; 
	transition: background .5s;  
}

.nav {
  background-color: black;
}

.nav ul {
	list-style: none;
	margin: 0 auto; 
	padding: 30px 0;
	text-align: left; 
}

/* word spacing achieved with the margin attribute. Word-spacing woudn't work, and I don't know why.*/
.nav li {
  color: white;
  display: inline;
  margin-left: 10px;
}

.main {
  background-color: white;
}

.main .container {
	margin: auto;
  background-color: white;
}

.main img {
  float: left;
  margin-right: 50px;
  margin-top: 40px;
}

/* Jumbotron */
.jumbotron {
	height: 600px;
  color: white;
	text-align: right;
  background-image: url(https://s3.amazonaws.com/codecademy-content/projects/innovation-cloud/jumbotron_bg.jpg);
}

.jumbotron .container {
	position: relative;
	top: 220px;
}

.jumbotron p {
  margin-bottom: 20px;
  padding: 20px 0;
}
.jumbotron .btn {
  margin-top: 50px;
  padding: 10px 34px;
}

.footer { 
	font-size: 14px;
  background-color: black;
  clear: both;
}

/* Media Queries */
@media (max-width: 500px) {
  .header h1 {
    font-size: 50px;
    line-height: 64px;
  }

  .main, .jumbotron {
    padding: 0 30px;
  }


#4

So where is the mistake?


#5

After digging and hunting I realised that the grey is margins from the different div's, now we can't take out those margins as it won't look nice.

When you have a margin the body's background color shows so in this case its set grey..

So if you edit the body tag:

body {
	font-family: 'Roboto', sans-serif;
	font-weight: 100;
}
//add background white:
  background-color: white;

should do the trick


#6

Right, you are. Thanks!


#7