How can I align a text with a font awesome 5 icon?

Diesan Romero

Which property can I use to align vertically the font awesome icon with the word support? I mean this navigation list:

<nav class="nav">
         <ul class="nav__list--second">
            <i class="far fa-life-ring fa-2x"></i>
            <a href="/support">Support </a>
         </ul>
      </nav>

@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');

body {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
   font-family: 'Lato', sans-serif;
   font-size: 16px;
}

header {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   width: 95vw;
   padding: 10px;
   margin: 10px;
}

header .brand img {
   width: 60px;
}

header nav ul {
   list-style: none;
}

ul.nav__list--first {
   vertical-align: middle;
}

header .nav__list--first li,
header .nav__list--second li
{
   text-decoration: none;
   display: inline;
   margin: 10px;
}

header .nav__list--first li a,
header .nav__list--second li a {
   text-decoration: none;
   
}
<head>
<script src="https://kit.fontawesome.com/69b14a4680.js" crossorigin="anonymous"></script>
</head>
<header>

      <div class="brand">
         <a href="/">
            <img src="./assets/images/logo.png" alt="GEM Logo" />
         </a>
      </div>

      <nav class="nav">
         <ul class="nav__list--first">
            <li>
               <a href="/">Home</a>
            </li>
            <li>
               <a href="/company">Company</a>
            </li>
            <li>
               <a href="/solutions">Solutions</a>
            </li>
         </ul>
      </nav>

      <nav class="nav">
         <ul class="nav__list--second">
            <i class="far fa-life-ring fa-2x"></i>
            <a href="/support">Support </a>
         </ul>
      </nav>
   </header>

   <div class="container">

      <main id="main">
         <div class="main">
            
         </div>
      </main>

      <section id="why-choose-us">
         <div class="container">
            <div class="card">
               <div class="card-icon">
                  <i>icon</i>
               </div>
               <div class="card-description">
                  <p>Description</p>
               </div>
            </div>
            <div class="card">
               <div class="card-icon">
                  <i>icon</i>
               </div>
               <div class="card-description">
                  <p>Description</p>
               </div>
            </div>
            <div class="card">
               <div class="card-icon">
                  <i>icon</i>
               </div>
               <div class="card-description">
                  <p>Description</p>
               </div>
            </div>
         </div>
      </section>
   
      <section id="about-us" class="about-us">
         <div class="title">
            <h2>Our Team</h2>
         </div>
         <div class="container">
            <div class="card">
               <img src="./assets/images/team/enrique.jpg" alt="Enrique Massuet" />
               <p>Enrique Massuet</p>
               <p>CEO</p>
               <p>Medical Insurance Specialist.</p>
               <div class="personal-social-icons">
                  <a href="https://twitter.com/uno ahi">
                     <i class="fab fa-twitter"></i>
                  </a>
                  <a href="https://www.facebook.com/emassuet">
                     <i class="twitter"></i>
                  </a>
                  <a href="https://instagram.com/emassuet">
                     <i class="twitter"></i>
                  </a>
                  <a href="mailto://[email protected]">
                     <i class="twitter"></i>
                  </a>
               </div>
            </div>
            <div class="card">
               <img src="./assets/images/team/giosvel.jpg" alt="Giosvel Carril" />
               <p>Giosvel Carril</p>
               <p>CFO</p>
               <p>Life Insurance Specialist.</p>
               <div class="personal-social-icons">
                  <a href="https://twitter.com/uno ahi">
                     <i class="fab fa-twitter"></i>
                  </a>
                  <a href="https://www.facebook.com/emassuet">
                     <i class="twitter"></i>
                  </a>
                  <a href="https://instagram.com/emassuet">
                     <i class="twitter"></i>
                  </a>
                  <a href="mailto://[email protected]">
                     <i class="twitter"></i>
                  </a>
               </div>
            </div>
            <div class="card">
               <img src="./assets/images/team/diesan.jpg" alt="Diesan Romero" />
               <p>Diesan Romero</p>
               <p>CTO</p>
               <p>Technology and Data Science Expert/</p>
               <div class="personal-social-icons">
                  <a href="https://twitter.com/diesanromero">
                     <i class="fab fa-twitter"></i>
                  </a>
                  <a href="https://www.facebook.com/diesan.romero.56">
                     <i class="fab fa-facebook-f"></i>
                  </a>
                  <a href="https://instagram.com/diesanromero">
                     <i class="fab fa-instagram"></i>
                  </a>
                  <a href="https://www.linkedin.com/in/diesanromeros/">
                     <i class="fab fa-linkedin-in"></i>
                  </a>
                  <a href="mailto://[email protected]">
                     <i class="far fa-envelope"></i>
                  </a>
               </div>
            </div>

         </div>
      </section>
   </div>
   
   <footer class="footer">
      <div class="copyright">
         <p>Copyright</p>
      </div>
      <ul class="social-icons">
         <a href="">
            <i class="fab fa-twitter"></i>
         </a>
         <a href="">
            <i class="fab fa-facebook-f"></i>
         </a>
         <a href="">
            <i class="fab fa-instagram"></i>
         </a>
         <a href="https://www.linkedin.com/company/gemfsolutions/">
            <i class="fab fa-linkedin-in"></i>
         </a>
      </ul>
   </footer>

Natixco

Just make it flex and align the items center.

.nav__list--second {
  display: flex;
  flex-direction: row;
  align-items: center;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how can I align font awesome icon in bootstrap button?

CSS - Align Font Awesome icon with a paragraph of text

How to align font-awesome icon vertically

How can I make a font awesome icon appear behind other text, as to emulate a background image?

How can I chnage the relative size of the text inside font-awesome icon?

How can i make i custom font awesome icon?

How do I get text below Icon button with font awesome

Angular: How May I change Font Awesome icon and Text on condition

How can I show only outline for a Font Awesome icon?

How can I use a font awesome brand icon in an angular component?

How can I make a Font Awesome Icon Stop spinning on Click?

How can I apply a Font Awesome icon to a custom file input?

CSS vertically align center font awesome icon to text

How to align list Items with font-awesome icon next line text?

How to place text over font awesome icon?

How to insert font awesome icon into text input?

How to position an Awesome Font Icon after a text

how to get unicode for font awesome icon 5?

How can I get Font Awesome 5 to work with React?

How can we use Font Awesome Icon in CSS? I want to display an icon after heading

How to vertically align text with icon font?

Flutter: font_awesome_icon pro version give error ? How can i set path of font_awesome cloned repo?

Align text to font awesome icons

Use Font Awesome (5) icon in input placeholder text

Text overlapping Font Awesome Icon

Font Awesome icon behind text

How I can align icon next to text of MaterialButton with defined padding?

How can I align a Material icon & header text on the same line?

How do I add Add text below font awesome icon Links?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive