Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialprofessionalb
Full Stack JavaScript Techdegree Student 5,082 PointsWhy are we not using icons instead of words for the buttons...
I know this isn't the point of this exercise, but at some point, are we going to learn how to use icons (maybe from Font Awesome) instead of words for our buttons?
The problem with words is they need to be localized. This is partially why all of Ikea's instructions for their furniture are displayed in pictures, not words.
1 Answer
Steven Parker
231,269 PointsUsing Font Awesome for button icons is relatively easy, just load it from any reliable CDN in your <head> section:
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/font-awesome/5.10.2/css/font-awesome.min.css">
And then include the icon elements in your buttons, with or without text labels.
<button><i class="fab fa-facebook-square"></i></button> <!-- just buttons ("Ikea style") -->
<button><i class="fab fa-whatsapp"></i></button>
<button><i class="fab fa-tumblr-square"></i></button>
<button><i class="fab fa-instagram"></i></button>
<button><i class="fab fa-twitter"></i></button>
<button><i class="fab fa-weixin"></i></button>
<button><i class="fab fa-skype"></i> Skype</button> <!-- with text also -->
Finally, style as you like in CSS:
button {
font-size: 32px;
min-width: 50px;
}
.fab {
color: firebrick;
}