|
Posted by fleemo17 on April 1, 2005, 3:16 pm
Please log in for more thread options
I'm wondering whether it's better to leave an alt tag blank (alt=" ")
or specify something like "alt='spacer'" when referring to objects that
merely help the layout of the page?
-Fleemo
|
|
Posted by Lars Eighner on April 1, 2005, 6:56 pm
Please log in for more thread options
In our last episode,
the lovely and talented fleemo17@comcast.net
broadcast on comp.infosystems.www.authoring.html:
> I'm wondering whether it's better to leave an alt tag blank (alt=" ")
> or specify something like "alt='spacer'" when referring to objects that
> merely help the layout of the page?
I think it is better to have an empty ALT (alt="") for images
which are purely decorative (srollwork, etc.). Putting a blank
in the ALT makes it show up as something where it is not wanted.
Using images for spacing never was desirable, but when
implimentations of CSS were very spotty, some years back, I
defended it as necessary in some cases. There is no longer any
good reason to use spacer images.
--
Lars Eighner eighner@io.com http://www.larseighner.com/ Fast, Cheap, Good: Choose any two.
|
|
Posted by David Ross on April 2, 2005, 12:08 am
Please log in for more thread options
Lars Eighner wrote:
>
> In our last episode,
> the lovely and talented fleemo17@comcast.net
> broadcast on comp.infosystems.www.authoring.html:
>
> > I'm wondering whether it's better to leave an alt tag blank (alt=" ")
> > or specify something like "alt='spacer'" when referring to objects that
> > merely help the layout of the page?
>
> I think it is better to have an empty ALT (alt="") for images
> which are purely decorative (srollwork, etc.). Putting a blank
> in the ALT makes it show up as something where it is not wanted.
>
> Using images for spacing never was desirable, but when
> implimentations of CSS were very spotty, some years back, I
> defended it as necessary in some cases. There is no longer any
> good reason to use spacer images.
I found that Internet Explorer fails to display the borders around
empty table cells properly. If I have an empty cell, I put a small
blank image there; IE then displays it correctly. The ALT
attributes of these null images is ALT="".
Before any table where I do this, I have a paragraph with the CSS
class "nostyle" that explains the null images:
.nostyle { display: none }
I do this with the assumption that an audio browser vocalizing ALT
attributes would not use style-sheets. Thus, the user would hear
an explanation of why there are images without any ALT text.
Anyone using a browser with style-sheets would not see that
paragraph.
--
David E. Ross
<URL:http://www.rossde.com/>
I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
|
|
Posted by jake on April 2, 2005, 10:23 am
Please log in for more thread options
>Lars Eighner wrote:
>>
>> In our last episode,
>> the lovely and talented fleemo17@comcast.net
>> broadcast on comp.infosystems.www.authoring.html:
>>
>> > I'm wondering whether it's better to leave an alt tag blank (alt=" ")
>> > or specify something like "alt='spacer'" when referring to objects that
>> > merely help the layout of the page?
>>
>> I think it is better to have an empty ALT (alt="") for images
>> which are purely decorative (srollwork, etc.). Putting a blank
>> in the ALT makes it show up as something where it is not wanted.
>>
>> Using images for spacing never was desirable, but when
>> implimentations of CSS were very spotty, some years back, I
>> defended it as necessary in some cases. There is no longer any
>> good reason to use spacer images.
>
>I found that Internet Explorer fails to display the borders around
>empty table cells properly. If I have an empty cell, I put a small
>blank image there; IE then displays it correctly. The ALT
>attributes of these null images is ALT="".
>
>Before any table where I do this, I have a paragraph with the CSS
>class "nostyle" that explains the null images:
> .nostyle { display: none }
>I do this with the assumption that an audio browser vocalizing ALT
>attributes would not use style-sheets. Thus, the user would hear
>an explanation of why there are images without any ALT text.
>Anyone using a browser with style-sheets would not see that
>paragraph.
Not really a good idea as most AT UAs will respect the 'display:none'
and not speak anything styled as '.nostyle' ;-)
One common technique is to position the text in hyperspace (<------way
over there) so that its not visible in the browser's viewing space, but
will be seen and spoken by the AT UA.
(... although alt="" is probably adequate in such circumstances.)
regards.
>
--
Jake
|
|
Posted by Jukka K. Korpela on April 2, 2005, 6:46 pm
Please log in for more thread options
> I found that Internet Explorer fails to display the borders around
> empty table cells properly.
IE follows the old semi-official (see HTML 3.2 spec) practice in this
respect as well as the practice that a space counts as empty, no-break
space ( ) as nonempty. Of course, you cannot always afford putting
a character into a cell. Then again, most empty cells in data tables
would best be replaced by cells with some actual content, if only
a dash or zero or "." for example.
> If I have an empty cell, I put a small
> blank image there; IE then displays it correctly. The ALT
> attributes of these null images is ALT="".
That's a common workaround, and rather harmless if you have that
alt="".
You could also set
table { border-collapse: collapse; }
which works on IE 6 and puts borders around empty cells too.
Of course you might not want to make borders collapse with no spacing
between cells.
> Before any table where I do this, I have a paragraph with the CSS
> class "nostyle" that explains the null images:
> .nostyle { display: none }
Don't. It just confuses some people without helping anyone. And there's
no inherent connection between showing images and applying stylesheets.
--
Yucca, http://www.cs.tut.fi/~jkorpela/ Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
|
| Similar Threads | Posted | | What's at the end of empty xhtml tags? | February 19, 2006, 2:55 am |
| Tidy trimming empty tags | August 29, 2005, 6:30 pm |
| Style tags -- Eeek how obese these tags make HTML! | November 8, 2006, 3:33 am |
| Meta Tags, Link Tags, other | September 27, 2005, 3:29 pm |
| Empty fragment | July 7, 2005, 10:10 am |
| Empty link | August 28, 2005, 12:33 pm |
| empty form actions | September 5, 2006, 4:48 pm |
| W3C Validator and empty body element | August 1, 2004, 2:37 am |
| Migrating to XHTML: empty elements | July 9, 2005, 12:55 pm |
| proper ways for empty link | November 18, 2005, 2:53 pm |
|