MOVE Supporting Help. And, yes, I put them in separate divs


#1

Can't seem to get all the divs on the same line. I even tried copying and pasting from other correctly done css examples. It makes me think there is something I have written that is preventing them from appearing on the same line.

Here is my HTML

<!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 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 activity on your phone, tablet, or computer.</p>
          </div>
        <div class="col"><h2>Compete</h2>
          <p>Set personal challenges and see how you rank against your friends.</p>
          </div>
        </div>
         <div class="clearfix">
        </div>
      </div>
    </div>


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

  </body>
</html>

and here is my 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 {
  background-image: url('https://s3.amazonaws.com/codecademy-content/projects/move/bg.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  height: 600px;
    }

.main h1 {
  font-size: 150px;
  margin: 0px;
}

.main p {
  font-size: 18px;
}


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

.supporting .col {
  float: left;
  width: 28%;
  padding: 10px;
  display: inline-block;
  }

.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;
}

/* 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;
  }
}

Any help? Thanks and happy new year!


#2

Sync and Compete are nested inside Move, this is not what you want. you want them beside each other:

<div class="col">
          <h2>Move</h2>
          <p>Become more active by tracking your runs, rides, and walks.</p>
       <!-- missing </div> to close col -->
        <div class="col"><h2>Sync</h2>

see comment in the above code


#3

WOW! All these DIV's inside of divs are so confusing! Thank you so much for your help, that seems to have done the trick!


#4

yep, you have to keep track of all the divs. Good indention helps. you could also add comments:

<div class="container">

</div><!-- container -->

combined with good indention, it should make life easier. Teach yourself good coding habits.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.