Create a class for a Bootstrap Button

Tell us what’s happening:
Hello
The objective is to
Create a new button element with the text “Like”.
Your new button should have two classes: btn and btn-default .
Make sure all your button elements have a closing tag.

I don’t seem to be able to successfully add the class for the btn and btn default

Your code so far


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }



  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

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

  .smaller-image {
    width: 100px;
  }
</style>

<div class="container-fluid">
  <h2 class="red-text text-center">CatPhotoApp</h2>
  <h2 class="btn" </h2>
  <h2 class="btn-default"</h2>


  <p>Click here for <a href="#">cat photos</a>.</p>

  <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

  <img src="https://bit.ly/fcc-running-cats" class="img-responsive" alt="Three kittens running towards the camera.">

  <p>Things cats love:</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">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <label><input type="button" name="Like"> Like</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/bootstrap/create-a-bootstrap-button

There are a few issues.

  1. There is an error in your HTML - you did not close the h2 element.
<h2 class="btn"> <-- close opening tag element </h2>
<h2 class="btn-default"</h2>
  1. That said, I think you only need a single <h2> element and two <button>. The bootstrap btn and btn-default classes are to be used on <button> elements.
<!-- Both the btn and btn-default class has been applied to this single button element. -->
<button class="btn btn-default">This is what you want.</button>

You can apply multiple classes to HTML elements. Just add the class name to the class attribute on the element. Class names are separated by a single space. Example:

<div class="warning error disabled some-class some-other-class"></div>
1 Like

Hello
task : Create a new button element below your large kitten photo. Give it the btn and btn-default classes, as well as the text of “Like”.
add this code below the second image :

<button class="btn btn-default">Like</button>

good luck

1 Like