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

CSS

Bootstrap Column cuts my content. How do I fix this?

I started learning Bootstrap using one of the resources in the library (Re-creating Smells Like Bakin' Website). I followed the instructions precisely but found out that my content is being cut-off. It's like they are far to the left and therefore cuts part of the content. Any suggestions on how to fix this?

Provide your code please

3 Answers

You didn't close one of the DIV element at the end. Try my code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Smells Like Bakin' Cupcake Company</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

   <link href='http://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>

   <link rel="stylesheet" href="css/style.css" type="text/css" media="screen">

  </head>
  <body>
    <div class="container">
        <div class="row">
          <div class="col-md-4">
            <h1>Smells Like Bakin'</h1>
          </div>
          <div class="col-md-5">
            <ul class="nav nav-pills">
                <li><a href="#">About</a></li>
                <li><a href="#">Cupcakes &amp; Prices</a></li>
                <li><a href="#">Locations</a></li>
                <li class="last"><a href="#">Contact Us</a></li>
            </ul>
          </div>
        </div>
    </div>

    <div class="row" style="padding: 0 20px">
      <div class="col-md-9">
        <h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts.</h1>
      <p><a href="#" class="btn">Browse Our Cupcakes</a></p>
      </div>
      <div class="col-md-3">
        <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">
      </div>
    </div>

    <div class="row" style="padding: 0 20px">
        <div class="col-md-7">
            <h2>Cupcake of the Week</h2>
            <p>This week’s featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavors will kick your taste buds into fiesta mode!</p>
            <img src="img/featured-cupcake.jpg" alt="Avocado Chocolate Cupcake">

            <h2>Inside the Kitchen</h2>
            <p>Smells Like Bakin’ started out in the garage of the husband wife duo Allison &amp; Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck. </p>
            <p><a href="#" class="btn-small">Read More</a></p>
        </div>
        <div class="col-md-5" style="margin-top: 5px">
            <h2>Fresh Out the Oven</h2>
            <p>Our newest cupcakes are <a href="#">Bacon Me Crazy</a> and <a href="#">Jalapeño So Spicy</a>. </p>
            <img src="img/new-cupcake-bacon.jpg" alt="Bacon Me Crazy">
            <img src="img/new-cupcake-jalapeno.jpg" alt="Jalapeno So Spicy">

            <h2>Get Bakin' with Us</h2>

            <div id="contact">
                <p>Call us: <span>1-555-CUP-CAKE</span><br>
                Email us: <a href="#">bakeon@smellslikebakin.com</a></p>
                <a href="http://www.facebook.com/SmellsLikeBakin"><img src="img/facebook.gif" alt="Facebook"></a>
                <a href="https://twitter.com/#!/smellslikebakin"><img src="img/twitter.gif" alt="Twitter"></a>
            </div>

        </div>
    </div> <!-- You didn't close this DIV element -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  </body>
</html>

Hello Sergey,

Here is the index.html code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Smells Like Bakin' Cupcake Company</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

   <link href='http://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>

   <link rel="stylesheet" href="css/style.css" type="text/css" media="screen">

  </head>
  <body>
    <div class="container">
    <div class="row">
      <div class="col-md-4">
    <h1>Smells Like Bakin'</h1>
      </div>
      <div class="col-md-5">
     <ul class="nav nav-pills">
        <li><a href="#">About</a></li>
        <li><a href="#">Cupcakes &amp; Prices</a></li>
        <li><a href="#">Locations</a></li>
        <li class="last"><a href="#">Contact Us</a></li>
      </ul>
      </div>
    </div>
    </div>
    <div class="row" style="padding: 0 20px">
      <div class="col-md-9">
        <h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts.</h1>
      <p><a href="#" class="btn">Browse Our Cupcakes</a></p>
      </div>
      <div class="col-md-3">
        <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">
      </div>

    </div>

    <div class="row" style="padding: 0 20px">

        <div class="col-md-7">
                <h2>Cupcake of the Week</h2>
            <p>This week’s featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavors will kick your taste buds into fiesta mode!</p>
            <img src="img/featured-cupcake.jpg" alt="Avocado Chocolate Cupcake">

                    <h2>Inside the Kitchen</h2>
            <p>Smells Like Bakin’ started out in the garage of the husband wife duo Allison &amp; Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck. </p>
            <p><a href="#" class="btn-small">Read More</a></p>

        </div>
        <div class="col-md-5" style="margin-top: 5px">

          <h2>Fresh Out the Oven</h2>
      <p>Our newest cupcakes are <a href="#">Bacon Me Crazy</a> and <a href="#">Jalapeño So Spicy</a>. </p>
      <img src="img/new-cupcake-bacon.jpg" alt="Bacon Me Crazy">
      <img src="img/new-cupcake-jalapeno.jpg" alt="Jalapeno So Spicy">

      <h2>Get Bakin' with Us</h2>

      <div id="contact">
        <p>Call us: <span>1-555-CUP-CAKE</span><br>
        Email us: <a href="#">bakeon@smellslikebakin.com</a></p>
        <a href="http://www.facebook.com/SmellsLikeBakin"><img src="img/facebook.gif" alt="Facebook"></a>
      <a href="https://twitter.com/#!/smellslikebakin"><img src="img/twitter.gif" alt="Twitter"></a>

        </div>

      </div>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  </body>
</html>

Here is the screenshot of what it looks like:

http://imgur.com/wGJ6XtV

Oh, right! It works just fine now. I guess I'll have to be more careful next time. Thank you very much!