How do I put icon and text paragraph in one line?

20,110

Julia, remove all your floats:

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>

<div class="date">
       <i class="fa fa-user-o" aria-hidden="true"></i>
       <p style="display: inline-block" >10/01/2018</p>
</div>

Also you might make it this way:

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>

<div class="date">
       <i class="fa fa-user-o"> 10/01/2018</i>
</div>
Share:
20,110

Related videos on Youtube

Юлия Твердохлеб
Author by

Юлия Твердохлеб

Updated on March 28, 2020

Comments

  • Юлия Твердохлеб
    Юлия Твердохлеб over 4 years

    I want to put my font awesome icon and text paragraph into one line. How can I fix this code?

    <div class="date" style="display: inline-block;">
           <i class="fa fa-user-o" aria-hidden="true" style="float: left;"></i>
           <p style="display: inline-block; text-align: right;float: left;" >10/01/2018</p>
         </div>
                               

  • Юлия Твердохлеб
    Юлия Твердохлеб over 6 years
    Works. Thank you!
  • Kosh
    Kosh over 6 years
    Happy to help !
  • MadeInDreams
    MadeInDreams over 6 years
    @KoshVery I see sorry. But i think it still missleading to have bootstrap mentionned in the first line of your code when it isnt really required here.