"i" turn an HTML button

-1
Hello, I would like my html 'i' to become a button, because from it I want to call a modal, I want to use an 'i' because I want to put the facebook icon, I tried to put it inside the button , but did not hit the design I want.

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#facebookModal">
                                        <i class="fab fa-facebook"></i>
                                    </button>

I wish I had just the 'i' and from it called the modal.

    
asked by anonymous 10.08.2018 / 02:34

2 answers

0

Plunker

<i data-toggle="modal" data-target="#facebookModal" class="btn btn-primary">
    <span class="fab fa-facebook"></span>
</i>
    
10.08.2018 / 03:08
0

If you use some framework js (angular, vuejs) you could only append the function next to I. As the example is unclear which approach, one would be:

<div class="btn btn-primary" >
    <a href="#">
        <i class="fab fa-facebook"></i>
    </a>

</div>
    
10.08.2018 / 03:03