2

I am trying to create a small donut hold icon - green.

Here is what I tried :

        .success-icon {
          border: 1px #62ae41 solid;
          border-radius: 10px;
          width: 30px;
          height: 30px;
        }
<div class="col-lg-3"><span class="sucess-icon"> </span>greater than or equal to 75%</div>

I couldn't get it to display. I am not sure what is going on.

5
  • Why not use fortawesome.github.io/Font-Awesome/icons , they have a bunch of icons ready to use Commented Mar 23, 2015 at 13:20
  • 2
    Just a note, you have a typo in your HTML. You have it currently as <span class="sucess-icon">. Commented Mar 23, 2015 at 13:22
  • 1
    Beat me to it @user65439 - Use .fa-circle-o Commented Mar 23, 2015 at 13:22
  • Good suggestion. Thank You. In term of performance, font-awesome Vs. CSS Vs. small image, which one is the best do you know ? I'm just curious. Commented Mar 23, 2015 at 13:23
  • @saadq : Good called, Thanks. Commented Mar 23, 2015 at 13:24

3 Answers 3

3

By default a <span> is display: inline and so height and width do not apply to it.

Set display: inline-block or some other value to which those properties apply.

You also need to make sure you spell your class names consistently or the selector will not match.

        .success-icon {
          border: 1px #62ae41 solid;
          border-radius: 10px;
          width: 30px;
          height: 30px;
          display: inline-block;
        }
<div class="col-lg-3"><span class="success-icon"> </span>greater than or equal to 75%</div>

Sign up to request clarification or add additional context in comments.

Comments

0

use display:inline-block in the style

.success-icon {
    border:1px #62ae41 solid;
    border-radius: 10px;
    width: 30px;
    height: 30px;
    display: inline-block;
}

Comments

0

Here are some extra styles to match it to what you were kinda wanting.

.success-icon {
    border: 8px #62ae41 solid;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    margin: 0 5px 0 0;
    display: inline-block;
    vertical-align: middle;
}
.col-lg-3{
      vertical-align: middle;
}
<div class="col-lg-3"><span class="success-icon"></span>greater than or equal to 75%</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.