-1
I’m using the fontawesome to put some icons in a web project I’m doing and I needed to add a <ul>
, And on that list, there’s going to be icones and in front of a writing, I’d like those writings to be all aligned with each other, how can I do that? I’ll leave a sample:
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<ul style="list-style-type: none;">
<li><i class="far fa-envelope"></i> [email protected]</li>
<li><i class="fas fa-mobile-alt"></i> +99 (99) 99999-9999</li>
<li><i class="fas fa-map-marker-alt"></i> City, State, Country.</li>
</ul>
</body>
</html>
My list for now is the same in the image above. As the icons have different sizes, they occupy more space horizontally and this makes the beginning of the texts not align with each other. How can I fix this?
Thanks for the answer, but when I put this class of yours, it got a little out of line due to
display: block
and thefloat: left
, when I left just thewidth
worked perfectly. :)– SaMuK
@Samuk if you solved the problem with the help of the colleague mark his answer as accepted, just click the below the arrow beside his answer. So you help the community and leave your question with an answer already accepted
– hugocsl