freeCodeCamp Challenge Guide: Line up Form Elements Responsively with Bootstrap

Line up Form Elements Responsively with Bootstrap


Solutions

Solution 1 (Click to Show/Hide)
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  h2 {
    font-family: Lobster, Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

</style>

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
    </div>
  </div>
  <img src="https://bit.ly/fcc-running-cats" class="img-responsive" alt="Three kittens running towards the camera.">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
    </div>
  </div>
  <p>Things cats <span class="text-danger">love:</span></p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <div class="row">
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Indoor</label>
      </div>
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Loving</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Lazy</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Crazy</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-7">
        <input type="text" class="form-control" placeholder="cat photo URL" required>
      </div>
      <div class="col-xs-5">
        <button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
      </div>
    </div>
  </form>
</div>
9 Likes

This helped me get unstuck.:grin:

Like usual, the syntax is key here. Just make sure your div classes are within their own arrows before the input. so < div>< input>< /div>

2 Likes

Please help! Iam still stuck with this challenge.what am I missing?

4 Likes

Mine looks exactly like yours and I’m stuck, too! All my div elements seem to have all their closing tags. We need help.

2 Likes

Hi
Did you get any solution yet??

i’m stuck too… All my div elements have closing tags and I can’t get through. Is there any way to skip?

1 Like

Something is buggy on this challenge. My code was not accepted until I copied and pasted it back into the challenge.

Make sure your </form> closing tag still exists

1 Like

thank you very much. it works perfectly :grin:

Make sure to clearly read the instructions and then make sure to use the correct syntax.

Hi everyone! I’m having a really tough time with this particular challenge. I can’t seem to figure out what I’m doing wrong. I’ve pretty much done exactly what I’m being told to do but apparently I’m missing something. I’d love a fresh perspective or at least advice that’s a little more in-depth.

Here’s my code:

What exactly am I doing wrong? Please advise!

I’m stuck exactly the same spot. I double checked and I didn’t see any thing missing but I could be wrong. I need help!

Does it? The inverted comas around col-xs-5 are missing in the camperbot solution. The correct answer is that there are 3 /div’ at the end! (2 new ones + one from the very beginning) :slight_smile:

2 Likes

Do it like Me

6 Likes