Text formatting being stubborn


#1

I'm battling with the text over the jumbotron picture - why is it not behaving like it should?

I would like the text to be white and justified to the right of the column, but it's being stubborn.

What am I missing?

thanks in advance!

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Arvo', serif;
  font-size: 16px;
}

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


/* Header */
.nav-pills li a {
  color: #d8192f;
}
.nav{
  float: right;
  display: inline-block;
  padding-top: 40px;
}


.header .container .col-sm-4{
position: relative;
  float: left;
  display: inline-block;
  padding-top: 40px;
  font-size: 40px;
}
.header .container{
  height: 130px;
}
.nav-pills li.active a,
.nav-pills li a:hover,
.section .btn:hover {
  background-color:rgba(216,25,47,1);
  box-shadow:0 2px 4px rgba(0,0,0,.5); 
  color:#fff;
}


/* Jumbotron */
.jumbotron {
  height: 500px;
  background: url(https://s3.amazonaws.com/codecademy-content/projects/bestbite/bg.jpg) no-repeat  center center;
    background-size: cover;
    height: 500px;
}
.jumbotron .h2 {
  font-size: 50px;
  color: white;
  text-align: right;
}
/* Banner */
.banner, .supporting {
  text-align: center;
  padding-top: 40px;
}

.banner {
  background-color:#36343f;
  height:180px; 
  color: #fff;
}

/* Media Queries */
@media (max-width: 680px) {
  .header h1 {
    margin-bottom: 20px;
    text-align: center;
  }
  .nav {
    float: none;
    margin: 0 auto;
  }
  .banner {
    height: 220px;
  }

  .nav-pills li:first-child a  {
    margin-left: 0;
  }
}

<!doctype html>
<html>
  <head>
    <link rel="stylesheet" href="https://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
    <link href='https://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>

    <div class="header">
      <div class="container">
<div class="col-sm-4">
  BestBite
      </div>
        <div class="nav">
  <ul class="nav nav-pills">
  <li role="presentation" class="active"><a href="#">About</a></li>
  <li role="presentation"><a href="#">Sign Up</a></li>
  <li role="presentation"><a href="#">Login</a></li>
</ul>
      </div>
    </div>            
      
    <div class="jumbotron">
      <div class="container">
        <div class="col-md-4">
          <h2>Browse.</h2>
          <h2>Create.</h2>
          <h2>Share.</h2>
      	</div>
      </div>
    </div>

    <div class="section banner">
      <div class="container">
        <h3>Always have the answer to "What's for dinner?"</h3>
      </div>
    </div>

    <div class="section">
      <div class="container">
      	<div class="page-header">
      	  <h3>Newest Contributions</h3>
      	</div>
        
      </div>
    </div>

    <div class="footer">
      <div class="container">
        
      </div>
    </div>
    
  </body>
</html>

#2

Any chance anyone has any clues? Many thanks.


#3

I've solved this myself. No period needed before h2.


#4

i think i found your problem:

.jumbotron .h2 {
  font-size: 50px;
  color: white;
  text-align: right;
}

you use .h2, because it start with a . it refers to a class of h2, but in your case it should refer to the element (h2)

Very good you solved it yourself :slight_smile:


#5

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