<i> tag in HAML

947 Views Asked by At

How do I create a I-tag in haml? Example:

<i class="fa fa-search"></i>

2

There are 2 best solutions below

0
On BEST ANSWER

HAML equivalent is

%i{class:"fa fa-search"}

You can look at http://codepen.io/anon/pen/BNwbEP and see the compiled view

enter image description here

0
On

You can also use the . shortcut:

%i.fa.fa-search

or the HTML-ish attribute variant

%i(class='fa fa-search')

I prefer the dot syntax.