Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.