Forum Moderators: open

Message Too Old, No Replies

Alt text with font graphics

To alt or not to alt?

         

sosidge

1:36 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



Just been messing around with graphic files in place of browser fonts to get nice anti-alias effect in headings etc.

And I'm wondering - should I be putting a descriptive alt text on these graphics? For example, graphic reads "Email us for more information", alt reads "Email us for more information".

The way I see it...

Pro's: Better SEO; Greater usability for people using screen-readers.

Con's: Looks a bit untidy with endless alt pop-ups.

Is there a rule? Or personal opinions?

txbakers

1:38 pm on Jul 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You do need an "alt" attribute for all images, it's standard.

You can use alt="" which will supress the tool tip. However, the alt text is used when the browser can't find the image.

For a tool tip, the proper attribute to use is "title"

encyclo

1:49 pm on Jul 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Con's: Looks a bit untidy with endless alt pop-ups.

As Tedster mentions, the

title
attribute should be used to add tool tips - only IE uses
alt
. You can use the method:

<img src="whatever.gif" alt="Alt description here" title="">

- which will supress the tool tips in IE, as the blank

title
takes precedence.

sosidge

2:17 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



Well you learn something new every day! Thanks for that.

R1chard

6:41 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



Nowadays almost ALL fancy effects can be obtained with standard text with CSS mapped onto the <h1> (filters and whatever are very versatile). If I'm using textual information (like all headings are), then I feel I owe it to my visitors to use the right format for the job (ie text). I use Photoshop for photographs and nothing else.

If you ask me, gif blocks are sooo 1989. You just can't update a site easily when you have them. Not to mention that it get you demoted in search results, and exposes you to the possibility of legal action in the future.

bedlam

8:09 pm on Jul 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it may be a little OT, but I can't just let this go...

Nowadays almost ALL fancy effects can be obtained with standard text with CSS mapped onto the <h1> (filters and whatever are very versatile).

Utter nonsense.

The typesetting tools available in css are mediocre at best. Besides, the selection of fonts reliably available on visitors' systems is vanishingly small. For many legitimate purposes, this selection of fonts is totally inadequate.

A better approach (that the original poster may be interested in) is to use graphical headings as background images to the semantically correct heading tag and indent the actual text right off the screen. Works in just about every situation.

Simple example of the inadequacy of css alone for layout: the community newspaper on my desk here has its headline in a display font (not available on my system or most systems - looks hand-lettered) in yellow, with a white outline, on an angle inside the front-page illustration. Totally impossible with css by itself, but simple to achieve with css & graphics - while maintaining semantically correct markup.

Looking forward, svg may get us out of such hacks and workarounds, but its widespread adoption is a ways off.

If you ask me, gif blocks are sooo 1989. You just can't update a site easily when you have them.

This opinion is 'sooo 1989'. You don't have to ftp every image up to the server anymore, you can use the webserver to do it for you whenever your header text changes. Given the increasing prominence of database driven dynamic sites, and the availability of good server-side technologies for manipulating images & type such asNetPBM, ImageMagick, GDlib, FreeType etc (and not to mention faster servers...), it's not actually that difficult to update graphical headers anymore. I think you can probably expect to see more graphical headers as time goes on, not fewer...

Not to mention that it get you demoted in search results...

Well, I suppose you mean that the absence of header tags in a page keeps you from ranking as highly as you might otherwise, right? If so, this problem is easily solvable using the approach mentioned above. Besides which, even if using graphical headers does prevent you ranking as highly, this is not the same as a 'demotion'.

...and exposes you to the possibility of legal action in the future.

How? If you actually use your fonts and images according to the license you acquired them under or created them on your own, what is the problem?

-B

sosidge

2:42 pm on Jul 12, 2004 (gmt 0)

10+ Year Member



So, to just lock this down in my head.

1. Always have an alt tag - and it should be more than just alt="".
2. If I definitely want a tool-tip - use a title tag.
3. If I definitely don't want a tool-tip - use title="".
4. If I don't care about whether there is a tool tip or not, don't bother with the title tag.

(title tags aren't really covered in my beginners HTML book)

Correct? It just seems a little code-heavy to have two tags with every image/link/etc.

encyclo

2:56 pm on Jul 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The alt attribute (img is the tag and src, alt and title are attributes, but that's another story!) is for alternative text to represent the image if the user has images switched off or is blind and using a screenreader. Internet Explorer uses alt as a tooltip, but this is not the real function of the alt attribute.

You should use title only if you definitely want the text to appear to a user (as a tooltip usually), or to hide the alt tooltip in IE. You should always offer a meaningful alternative to the image with alt for accessibility reasons.

R1chard

7:09 pm on Jul 12, 2004 (gmt 0)

10+ Year Member



he typesetting tools available in css are mediocre at best.

I don't agree. Almost any effect can be achieved. Seriously.

Besides, the selection of fonts reliably available on visitors' systems is vanishingly small.

Well, if you're bent on getting a specific face onscreen, then there's font embedding that can be used to put a font on any machine that may not have it installed.

But aside from that, people just don't care about fonts. If you give two or three alternative font suggestions (note the word "suggestions"), then you can select some so that most people will see something similar to what you recommend. And if the person only has 3 fonts installed on their system, then they clearly couldn't care less about fonts, so why you want to force them on them in the first place? I don't want to go forcing anything onto anyone. People want to be able to read the thing, so I'd question why you "need" to use a fancy font at all. A webmaster's job is to convey information, and one of the most important things about web design is using the right tools for the job. If your content is photographic, then use a photograph, but if your message is text, then you must use text. Note that I didn't prepare this reply in ImageMagick or any of the packages you mention- if I did that then you wouldn't be able to search/copy any of it.

But in ALL cases, if you use real text, then the user always gets something meaningful at their end. This is not guaranteed with images, due to a dozen obvious (and not so obvious) reasons.

indent the actual text right off the screen

Huh? You want to position text offscreen? That's not very intuitive, or very pleasing. If you're gonna do that, then why not just use CSS to make it transparent? Or invisible? Or not displayed? Surely all of these are much better that such a hack?

Aside from the obvious curiosity and disadvantages that this introduces, of essentially having everything duplicated.

on an angle inside the front-page illustration

Maybe you've got a point with the text being at an angle. I guess a future version of CSS may allow for the annoyance of having to tilt your head to one side to read something... But yes, CSS can be used to place text anywhere you want, including inside an illustration

Oh, and about the legal action: I was refering to people who weren't able to access your graphics, either due to physical disability, or hardware limitations.

bedlam

9:06 pm on Jul 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I will start this post with some on-topic stuff, but the rest of it might be considered to be massively off topic... Anyway:

indent the actual text right off the screen

Huh? You want to position text offscreen? That's not very intuitive, or very pleasing. If you're gonna do that, then why not just use CSS to make it transparent? Or invisible? Or not displayed? Surely all of these are much better that such a hack?

It's kind of a hack. I should have mentioned that I think it should only really be used if an alternate stylesheet is available. The idea is this:

  • Most sighted people surf with images on these days
  • Most non-sighted people will use screenreaders
  • The sighted folks should be able to read the graphics used in the backgrounds of the headers
  • By positioning the text offscreen, it is supposed to remain accessible to screenreaders in a way that non-displayed and invisible texts do not.
  • Problems presumably would arise if a surfer arrives with images off, thus the need for the alternate stylesheet.

This is a variant of the technique used by csszengarden with headers (I can't recall just now where I learned it). The html looks like this:


<h1><span>Header Text</span></h1>

And the CSS looks like this:

h1 {background:transparent url(example.gif) no-repeat top left;}

h1 span {position:relative; left:-5000px;}

/* CssZenGarden CSS has "h1 span {display:none;}" here instead */

So anyway, it's not perfect, but when delivered with an alternate stylesheet, should cover all the bases...

The on-topic bit ends here...

the typesetting tools available in css are mediocre at best.

I don't agree. Almost any effect can be achieved. Seriously.

No background in typography eh? A rather incomplete list of impossible-with-current-css effects in type would include (but not be limited to):

  • Pair kerning. This is a problem both with some pairs of letters and punctuation, and is also the reason why no one is using CSS to make drop caps with letters like 'A' or even 'O'.
  • The ability to surround a graphical element on a page (I know of the alternatives. Wretched, aren't they? E.g. Change your graphic and you have a two-hour stint of resizing all those divs ahead of you...)
  • Following a path with text
  • Real small caps instead of shrunken, deformed uppercase letters (which are arguably less readable) You could argue that this is really an argument for embedding fonts, since if you want to display real small-caps, then your font needs to have 'em in the first place and most of them don't...
  • Proper hyphenation. I.e. there is no fine control over how long a line will be (since you don't know about the visitor's settings for font-sizes, so you don't know either the size of the letters or the length of the line in any precise way), and therefore, you have no way to hyphenate properly.

These are all issues foremost because of issues with readability that they may cause. Hyphenation, for example, becomes more and more of an issue in the Roman alphabet the longer the words get so for other languages, or technical documents, this can be even more of a problem.

But aside from that, people just don't care about fonts.

What can I say? The entire history of writing and printing is at odds with this odd statement. You do know that you can surf over to Adobe or Letraset or elsewhere and purchase any of tens of thousands of different fonts, right?

Even setting issues of beauty and aesthetics aside for the moment (which I am reluctant to do; in typesetting, beauty = readability), what about sites/signs/printed matter that are supposed to sell or be fun?

[somebody with only three fonts on their system] clearly couldn't care less about fonts, so why you want to force them on them in the first place? I don't want to go forcing anything onto anyone.

First of all, it would be pretty difficult for me to 'force' any kind of printed material on anyone possessed of eyelids never mind someone with a web browser a mouse and access to more than three billion webpages. Furthermore, as long as I am using CSS, the user is quite free to pick an alternate stylesheet - either one that I provide, or their own. What problem?

People want to be able to read the thing, so I'd question why you "need" to use a fancy font at all.

Well, again, I never said anything about using 'fancy' fonts (I assume you mean display faces) in a context meant for continous reading. That said, I don't see how using a good display face for a headline etc prevents its being readable.

I also find it odd that you argue first that no one cares about the font a webpage uses, but then suggest that some fonts (according to your implication, any but those already present on a user's system) are totally inappropriate to the delivery of information.

A webmaster's job is to convey information

I disagree. This is one important part of the job, but it is clearly not the whole job.

You seem to think 1) that writing only conveys information by the semantic content of the words it contains, and 2) writing (and typesetting) has no other job than to convey information in this way.

Much can be added to almost any printed matter by improving the typography, and part of good typography is have a selection of different fonts for different purposes. Would you use comic-sans for a law firm's site? I doubt it.

and one of the most important things about web design is using the right tools for the job.

THIS, I can agree with. But one of the 'tools' for absolutely any job dealing with printed matter should be at least a basic understanding of the use and history of typesetting. Webmasters without such knowledge should be consulting graphic designers (just don't let 'em take over ;-)

-B

R1chard

8:14 pm on Aug 9, 2004 (gmt 0)

10+ Year Member



Interesting points, bedlam. It's been a while, so I'll just type a reply, and if it's off-topic, then I guess a mod can just close the thread...

h1 span {position:relative; left:-5000px;}

Sorry, but I just can't agree with anything like this. Not only are numbers like that a bad idea, but it makes way too many assumptions on what people "will be using".

Pair kerning

I'm not a typography expert, but I've not seen any problems with this in mine or any other pages. Same thing with hyphenation and smallcaps.

The ability to surround a graphical element on a page

Like a non-rectangular outline? It's all very arty, but I wouldn't class it as a neccessity.

Following a path with text

You mean like having the line of text go up and down in a wavy pattern?

The entire history of writing and printing is at odds with this odd statement. You do know that you can surf over to Adobe or Letraset or elsewhere and purchase any of tens of thousands of different fonts, right?

Yeah, sure, you and I love fonts (I've got a few hundred special ones myself, and I've spent literally weeks of my life tracking stuff down), but we are not the average person. Clearly fonts are an important form of artistic expression, but I'm not sure it goes much further than that. It most definately is not the end of the world if somebody gets a substitute. And the person on metered access at the end of the 28k modem (ie the majority) certainly is not bothered about fancy fonts.

as long as I am using CSS, the user is quite free to pick an alternate stylesheet

I guess so. But most people don't know what a stylesheet is... They don't even know what a cache is, or that you can reorganize your Bookmarks... So if they didn't bother to install any fonts, they're obviously not a graphic designer, or a person who cares about such things (or if they do care about such things, then they would have set their own preferences accordingly). So going out of your way to ensure they get a pixel-perfect version I what you have on your screen seems a little bit of a waste of time (both yours and theirs).

<to convey information> is one important part of the job, but it is clearly not the whole job

Maybe. But I still say that all fonts are optional. Sure, they can often improve things, especially in a printed environment (which is similar, but at the same time different to onscreen stuff, and in any case, wasn't mentioned by the thread starter). But a lot of people don't even consider the font (especially of body text) until you point it out to them. Maybe subconsciously they do...

Anyway, all computers have a least a small variety of useful fonts (well, almost all!), and it'll usually be configured to have a couple of them used for headings, quotations, links, whatever. So it's not much of an issue.