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

HTML

How does this code display an image?

I have been looking at the workings of http://www.firestonecompleteautocare.com

I like the design and wanted to know how the logo was displayed and if you look here:

<a id="header-logo-home" class="hlogo" href="/">Firestone Complete Auto Care™</a>

They don't actually have a link to the image so how does it display? With a server side language by any chance?

3 Answers

Hey Nick,

The logo is set as a background image within a CSS file.

background-image:url("../images/logo-fcac.png")

In http://www.firestonecompleteautocare.com/static-fcac/css/fcac.css

Even if it were defined with a server side language it would still have to make itself available for the browser to interpret in some way so it could then be displayed.

I literally just noticed it after I typed this post haha, is there any benefit from doing that? I don't see why the developers didn't just use HTML

I think the main benefit is that if they ever need to change the logo, they only need to change the url in the CSS and the change will automati-jically work on all of their HTML pages.