To align Ionicons with text, you can use CSS to adjust the vertical alignment of the icon. Here's an example code:
HTML:
<p><i class="ion icon ion-md-alert"></i> This is a warning message.</p>
CSS:
.ion {
vertical-align: middle;
padding-right: 5px; /* optional */
}
In this example, the .ion
class sets the vertical alignment of the icon to middle, which aligns it with the text. You can also add some padding to the right of the icon to add some spacing between the icon and the text, if needed.
Asked: 2023-05-04 16:47:25 +0000
Seen: 19 times
Last updated: May 04 '23