![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||||||
| ||||||||
|
|
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is marked up by CSS to be invisible or hidden. So... If I want to replace headings with images (because my client wants to use his specific font for headings where possible), what's the best way to do it? Clearly, I can use img tags with the relevant alt tag, but that loses me the importance structure that H tags would give me which, in turn, loses hierarchical structural integrity and, more importantly, accurate search-engine interpretation. |
|
In more detail: In the code snippet below, 'MainTitle8' and 'SubTitle5' are titles that should have the importance of H1 and H2 respectively. <div id="content-text" <p><img src="images/MainTitle8.gif" /></p <p><img src="images/Recette1.jpg" /></p <p>Marc Wery, Professeur de Cuisine. <br / Conseiller Culinaire. <br / Finaliste du Grand Prix Escoffier 1995. <br / 3éme au Trophée Européen 1995.</p <img src="images/SubTitle5.gif" align="left" / <p> </p <img src="images/Recette2.jpg" class="imgLeftFloat" / ...etc With FIR, I would do something like... <div id="content-text" <span><h1 class="swap">My main heading</h1></span |
|
...and CSS like ... h1.swap { height:22px; background-repeat:no-repeat; } h1.swap span {display:none;} |
|
h1#content-text { background-image:url("images/MainTitle8.gif"); } |
|
That way, CSS enabled visual browsers would get the image of the title, and anything else would get the plain old H1 or H2. |
|
Now, I gather, that's a no-no now, because some screen readers do interpret the CSS, and so would not see the hidden H tags. |
|
How is anyone else doing this? |
|
*(Fahrner Image Replacement - see http://www.stopdesign.com/articles/replace_text/ for a far better explanation than I can give) |
#3
| |||||||||
| |||||||||
|
|
Not if you mark them up as h1><img src="..." alt="MainTitle8"></h1 |
|
With FIR, I would do something like... <div id="content-text" <span><h1 class="swap">My main heading</h1></span You can't put an <h1> inside a <span |
|
...and CSS like ... h1.swap { height:22px; background-repeat:no-repeat; } h1.swap span {display:none;} That implies the span is inside the h1 (where it should be instead of outside like your html says) |
|
h1#content-text { background-image:url("images/MainTitle8.gif"); } Your CSS isn't correct for your HTML. The above selector would have to be "div#content-text h1" instead of "h1#content-text". |
|
That way, CSS enabled visual browsers would get the image of the title, and anything else would get the plain old H1 or H2. You would have had to set a height to the h1 as well, as I think it would collapse without content. |

|
Now, I gather, that's a no-no now, because some screen readers do interpret the CSS, and so would not see the hidden H tags. Display:none is generally not read, so indeed, a no-no. |
|
How is anyone else doing this? Like I said: h1><img src="image.jpg" alt="replacement of title in image"></h1 |

|
*(Fahrner Image Replacement - see http://www.stopdesign.com/articles/replace_text/ for a far better explanation than I can give) As they say on that page: "The original technique (FIR) described in the body of this article is no longer recommended for use, as it makes the hidden text completely inaccessible for certain screen readers. Instead, see one of the alternative techniques mentioned at the end of the article under “Important Notes”." |
|
I don't like the three alternative methods from those 'important notes' section either though. The less trickery, the better imo. |
#4
| |||
| |||
|
|
Just out of interest, why was (and indeed is) FIR preferred over putting an image and alt text inside an <hn></hn> pair? |
|
The technique is all over places like CS Zen Garden, for example. |
#5
| |||
| |||
|
|
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is marked up by CSS to be invisible or hidden. |
#6
| |||
| |||
|
|
Charlie King wrote: Just out of interest, why was (and indeed is) FIR preferred over putting an image and alt text inside an <hn></hn> pair? The only thing that might benefit from FIR is search engines, many (most?) of which do not index alt text, except possibly in image links. All FIR techniques have problems, some are worse than others. Most do poorly in graphical browsers when image loading is disabled. Worst case is the content becomes inaccessible. |
#7
| |||
| |||
|
|
But that still leaves me with the problem of wanting to use specific fonts and/or styling, without compromising accessibility or sacrificing SEO - hence my posting the question. |
|
At the moment, I do what I can to talk clients out of anything that can't be done with plain simple HTML and CSS - but it would be nice to have a suitable compromise. |
|
Do we know whether or not search engines read alt text inside an hn></hn> pair? |
#8
| ||||||||||
| ||||||||||
|
|
On Sun, 15 Jan 2006, Charlie King wrote: But that still leaves me with the problem of wanting to use specific fonts and/or styling, without compromising accessibility or sacrificing SEO - hence my posting the question. I'm assuming that the "specific fonts" you are referring to are ones which the average reader wouldn't be expected to have. |
|
I wouldn't say that I'd actually *recommend* this, but if the site's sponsors are, like so many, narrow-minded enough to believe that MSIE is the only browser, you could use MS WEFT[1] to supply specific font(s) in embedded format to MSIE and get the visual results that they wanted, in such a way that it does no harm to www-compatible browsers. If it's only needed for a few headlines, it may only need a few different letters in the embedded "font object", so it could be quite small - comparable with the size of an inline image. |
|
No, I'm not really enthusiastic about that answer, but it *is* a fairly harmless technique if it fits your design constraints, and if you apply it appropriately. Other browsers will harmlessly disregard the relevant CSS/2.0 properties, either because they don't implement them (the CSS rules for dealing with unimplemented features guarantee that), or because, even if they understand the @font-face directive, they recognise that the embedded font format is not one that they can use. |

|
At the moment, I do what I can to talk clients out of anything that can't be done with plain simple HTML and CSS - but it would be nice to have a suitable compromise. Well, the only other option for getting the desired visual results *does* seem to be an image of text. If it's only decorative then it could be put into the background; otherwise, out of all the trick techniques that I've seen, I haven't seen one that seems to be overall better than the plain and simple <img> with appropriate alt= text. |
|
I'm not saying that's ideal, but it seems to me to be the least-bad recourse if the site's sponsor insists. |

|
Do we know whether or not search engines read alt text inside an hn></hn> pair? This is reasonably well known and documented at search engine review sites, AFAIK. Last that I heard, the regular Google database (not the images one) will only include ALT texts in its indexing if they are inside <a href=...> links. Altavista used to index all ALT texts, but my knowledge about that may be way out of date. |
|
If we're talking about a heading which identifies the company or organisation, then all of the non-"Home"[2] pages can link to their "Home" page from this "heading", and you're pretty much home and dry. The actual Home page shouldn't link to the Home page itself (it's poor practice for a page to offer link(s) to itself, except where you're jumping to anchors within the page), but presumably something useful can be linked from there too - a German home page might link to the obligatory "Impressum" page, which gives the details of who is legally responsible for the site contents, copyright claims etc., and we could well do something similar. |

|
h t h |
|
[1] The more cautious MSIE users who set enhanced security options against untrusted web sites, will get a security alert about downloading an embedded font, but the site's sponsors almost certainly won't be discerning enough to realise that or worry about it. |

|
[2] Just a routine note that in the original TimBL concept of a site's structure, he distinguished between a "Home" page and a "Welcome" page, and in my opinion this is still a reasonable distinction to keep in mind. http://www.w3.org/Provider/Style/Etiquette.html |
#9
| |||
| |||
|
|
If we're talking about a heading which identifies the company or organisation, then all of the non-"Home"[2] pages can link to their "Home" page from this "heading", and you're pretty much home and dry. The actual Home page shouldn't link to the Home page itself [...] |
|
That's not really what I'm after - your earlier remarks covered what I was talking about ![]() |
#10
| |||
| |||
|
|
However, the alt text stands a better chance of being indexed, across search services, putting the image inside a link, along these lines - hN><a href="/"><img src="foocorp.img" alt="Foo Corp." ...></a></hN |
|
assuming that href="/" is a reference to the web site's "home" page. (With suitable CSS styling, optional title= attributes, etc.) I was just saying that if this also appears on the "home" page itself, it would be good practice not to link that one to the same page; some other appropriate page could be found for linking to. Just what that page should be, is up to you - I suggested something like the German "Impressum", but - whatever you choose, really. hope that makes sense |
![]() |
| Thread Tools | |
| Display Modes | |
| |