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

CSS

css image replacement technique best for seo performance..

I'm just looking for the best way to replace a text with an image i know of a few ways

.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}

.ir {
    font: 0/0 serif;
    text-shadow: none;
    color: transparent;
}

is there one best way? or are we just using loop holes still?

2 Answers

I think best practice is if the image contains meaningful content, just put it into your HTML as an <img> tag and put a good "alt" attribute in for accessibility. If you must have hidden text along with your image, there are a wide variety of methods for doing that, and I don't know that any of them are particularly better than others.

A lot of it now comes down to accessibility, as Claudiu Bancos mentioned.

Here are some articles exploring different options: