Project: MOVE positioning div class"col"


#1



Hello,

I am having trouble positioning my divs on the project MOVE.

From the example you can see 'Move', 'Sync' and 'Compete' line up across the web page. However I am looking at the code given in the example and I can't see any major differences, but I am still a noobie so there may be something totally obvious I am missing, if someone could point out what it is I would be super grateful! (I have uploaded a picture of what my webpage looks like)


<!doctype html>
<html>
  <head>
    <link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
    <link rel='stylesheet' href='style.css'/>
  </head>
  <body>

    <div class="main">
      <div class="container">
        <h1> Move </h1> 
        <p> Form healthy habits to take your fitness to the next level </p>
        <a class="btn" href="#"> Start Now </a> 
        
      </div>
    </div>
    
    <div class="supporting">
      <div class="container">
        <div class="col">
          <h2>Move</h2>
          <p>Become more active by tracking your runs, rides, and walks.</p>
         	<div class="col"> 
          		<h2>Sync</h2> 
              <p>Access your files on mobile, tablet or 									PC.</p>
          </div>
          <div class="col">
            <h2>Compete </h2>
            <p>Set personal challenges and compete with your friends. </p>
        </div>
        
        
        <div class="clearfix"></div>
      </div>
    </div>


    <div class="feature">
      <div class="container">
        
      </div>
    </div>
    

  </body>
</html>

CSS 

html, body {
  margin: 0;
}

h1, h2, a {
  font-family: 'Oswald', sans-serif;
}

p {
  font-family: Helvetica, Arial, sans-serif; 
}

.container {
  width: 940px;
  margin: 0 auto;
}

/* Main */
.main {
  height: 600px;
  background-image: url("https://s3.amazonaws.com/codecademy-content/projects/move/bg.jpg");
  text-align: center; 
}

.main h1 {
  font-size: 150px;
  color: #fff;
  display: block; 
  margin-top: 50px;
}

.main p {
  font-size: 18px;
  color: #fff;
  margin: 0px 0px 20px 0px;
  
  
}

.main .btn {
	background-color: #1c1c1c;
  color: #fff;
  font-size: 18px; 
  padding: 8px 30px; 
  text-decoration: none; 
  display: inline-block;
}


/* Supporting */
.supporting {
  text-align: center;
  padding: 50px 0 80px;
  background-color: #1c1c1c; 
}

.supporting .col {
  float: left;
  width: 28%;
  padding: 10px;
}

.supporting h1,
.supporting h2 {
  color: #ffa800;
  font-size: 20px;
  margin-bottom: 10px;
}

.clearfix {
  clear: both;
}

.supporting p {
  color: #efefef;
  margin-bottom: 20px;
  line-height: 20px;
  font-size: 12px;
}

.supporting .btn {
  background-color: #eee;
  color: #1c1c1c;
  font-size: 18px;
  padding: 8px 30px;
  text-decoration: none;
  display: inline-block;
}

/* Feature */
.feature {
  height: 600px;
}

.feature h1,
.feature h2 {
  color: #fff;
  font-size: 40px;
  margin: 0;
  padding:50px 0 0;
}

/* Footer */
.footer {
  height: 600px;
}

.footer h1,
.footer h2 {
  color: #fff;
  font-size: 40px;
  margin: 0 0 20px 0;
  padding:50px 0 0;
}

.footer p {
  color: #fff;
  margin: 0 0 20px 0;
  font-size: 18px;
}


@media (min-width:600px) {
  .main h1 {
    font-size: 200px;
  }

  .supporting .col {
    width: 30%;
  }

  .supporting h2 {
    font-size: 40px;
  }

  .supporting p {
    font-size: 14px;
  }

  .feature h2 {
    font-size: 60px;
  }
}


#2

you wrote your own grid system?

Anyway, there is a problem here:

<div class="col">
          <h2>Move</h2>
          <p>Become more active by tracking your runs, rides, and walks.</p>
         	<div class="col">

you forgot to close the "move" col, meaning the next col is nested inside of it. I would close the move col, fore starting the next col


#3

Thanks for the advice so far, I wrote the grid system into it because upon inspecting the example page I could see that is what they have done. Is there a simpler way to achieve the same goal without using the grid system?

I have corrected this but the problem remains!


#4

i don't see how the problem persist if you close the div correctly as i did here

Grid system is by far the best way to achieve this


#5

I reset my code and re-wrote it keeping in mind to close the divs and working off your example and it has worked!

Thanks a lot stetim!