0

Having a bit of a hard time pulling an icon to the right. I'd like it to be to the right and not fall off the line with the text.

Where am I going wrong?

.featuresCard{
width: 80vw;
padding: 12px;
margin-bottom: 15px!important;
color: white;
background-color: #e74c3c!important;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>



<div id='results1' class="card results1 resultsList featuresCard" >Item 1 <i class="pull-right fa fa-check"></i> </div>

<div id='results2' class="card results2 resultsList featuresCard"> Item 2 <i class="pull-right fa fa-check"></i></div>

<div id='results3' class="card results3 resultsList featuresCard"> Item 3 <i class="pull-right fa fa-check"></i></div>

3
  • Do you want to place the icon on the far right of the <div> or to the right of the 'Item' word? Commented Oct 3, 2019 at 18:30
  • I'm looking for it to be: [ Item 1 check ] Commented Oct 3, 2019 at 18:31
  • I have added it a working solution for you. Commented Oct 3, 2019 at 18:38

1 Answer 1

2

I would suggest you to look into flexbox, pretty cool stuff. If you want the text and icon to be next to each other, just remove the justify-content.

Check it out here: https://jsfiddle.net/xwh59uy6/1/

display: flex !important;
flex-direction: row !important;
align-items: center !important;
justify-content: space-between !important;
Sign up to request clarification or add additional context in comments.

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.