I am trying to align text next to this icons but icons don’t want to cooperation. Just kidding… I am totally noob on front-end, especially with bootstrap. Can someone tell me how to do it?
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<li class="active">
<a href="#"><span class="fa fa-database mr-3"></span> Menedżer baz danych</a>
</li>
<li>
<a href="#"><span class="fas fa-project-diagram mr-3"></span> Menedżer diagramów ER</a>
</li>
<li>
<a href="#"><span class="fa fa-folder-open mr-3"></span> Katalog diagramów ER</a>
</li>
<li>
<a href="#"><span class="fa fa-trophy mr-3"></span> Top Review</a>
</li>
<li>
<a href="#"><span class="fa fa-cog mr-3"></span> Settings</a>
</li>
<li>
<a href="#"><span class="fa fa-support mr-3"></span> Support</a>
</li>
<li>
<a href="#"><span class="fa fa-sign-out mr-3"></span> Wyloguj</a>
</li>
How its look like for real:
2
Answers
This might be a good start. Please note a
li
should always be inside anul
.If you want to vertically align icons and text on their line, you can use flexbox in your CSS stylesheet: