I want to create a rounded button in BS3 (a perfect circle), with a single fontawesome(4.0) icon in the center.
So far, I have the following code:
HTML:
<a href="#" class="btn btn-default"><i class="fa fa-user"></i></a>
What would the CSS markup be to make this button a perfect circle?
you can do something like adding a class to add border radius
HTML:
<a href="#" class="btn btn-default btn-circle"><i class="fa fa-user"></i></a>
CSS:
.btn-circle { width: 30px; height: 30px; text-align: center; padding: 6px 0; font-size: 12px; line-height: 1.42; border-radius: 15px; }
in case you wanted to change dimension you need to change the font size or padding accordingly
(Not cross-browser tested), but this is my answer:
.btn-circle { width: 40px; height: 40px; line-height: 40px; /* adjust line height to align vertically*/ padding:0; border-radius: 50%; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With