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 trial
Julie Baer
4,256 PointsAdding iconography on CSS page
In the video titled Adding Iconography in the Web development track, the phone, mail, and twitter icons were added to the page using CSS. Could they also have been added using HTML like all of the other images or is there a reason to use CSS in this case?
2 Answers
Aaron Wuerch
7,024 PointsThey could be with html yes ... but you would eventually have to style them anyways to get the proper sizing, and placement with the Text that they had in that lesson. CSS was used in that case because it made the job easier, and with good standards. Adding an img tag in html then trying to inline style it would be a bit of a mess, and most likely wont give you the look you are trying to get.
Hope that helps!
Austin Whipple
29,847 PointsIn addition to what Aaron mentioned, adding icons with CSS further separates content (text, links, and images relevant to site's content) from design. Rather than using HTML to add design elements directly in the HTML, CSS allows you to keep all aspects of the design contained in one spot to keep your site and its code easy to read and modify for both machines and people.
Julie Baer
4,256 PointsThanks Austin - your post helped me to distinguish between the icons as a design element, versus the other images on the site, I realize now that's what I wasn't understanding before. I appreciate the help!
Julie Baer
4,256 PointsJulie Baer
4,256 PointsThanks for the reply Aaron - I will watch the video again and keep this logic in mind. Thanks for taking the time to explain this!