Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xhtml: <image alt="blah blah" ... /> - what should it look like?

Reply
Thread Tools

xhtml: <image alt="blah blah" ... /> - what should it look like?

 
 
mark4asp
Guest
Posts: n/a
 
      01-08-2008
<image alt="blah blah" ... /> - what should it look like?

When I use <image alt="blah blah" ... />

The alt value of an image tag is rendered inconsistently:
* In Safari I see nothing. The alt value is ignored.
* In IE6 I see a tooltip
* In Firefox the alt attribute value is displayed on top of the image.
With a small image the text overflows to the rhs.
* In Opera the actual the alt attribute value is displayed on top of
the image. With a small image the text is trucated within the width
specified for the image.

What's going on here? Do 3/4 of these browsers have bugs or is the
xhtml specification missing something?

The only sensible solution to this is for me to use blank alt tags
<image alt="" ... /> and to use a title attribute instead.

The empty alt tag is still needed because I want to use xhtml markup.
However now my <asp:Image> [asp.net] tags are broke because when I when
I specify them as <asp:Image AlternateText ="" ... /> they are rendered
as <asp:Image ... /> i.e. with no alt tag at all.


[FireFox 2.0.0.11, Opera 9.25, Build 8827, Safari 3.0.4 (523.13), IE 6
sp6 (with latest updates) all running on WinXP sp2 with latest updates
on asp.net 2 site using ms ajax.]

 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      01-08-2008
mark4asp schrieb:
> <image alt="blah blah" ... /> - what should it look like?


Don't know. In XHTML there is no image element, it's called img. The img
element's alt attribute is an _alternative_ for the image, to be
rendered if the image itself is not rendered (e.g. in a text browser, a
screen reader or voice browser, or when image rendereing is disabled in
a graphical browser). If you want a tooltip, you may get it when adding
a title attribute to the img element.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
 
Reply With Quote
 
 
 
 
Pavel Lepin
Guest
Posts: n/a
 
      01-08-2008

Follow-ups to comp.infosystems.www.authoring.html

mark4asp <> wrote in
<4783548b$0$20530$>:
> <image alt="blah blah" ... /> - what should it look like?


The Recommendation doesn't specify what should it look like
because alt attribute represents an alternate textual
description for non-textual content in question, to be
provided in environments where rendering of original
content is impossible or undesirable (see HTML 4.01, 13..

> The only sensible solution to this is for me to use blank
> alt tags <image alt="" ... />...


It's a Very Bad Practice.

> ...and to use a title attribute instead.


Note that 'instead' is not appropriate. Those attributes
have different semantics (see 7.4.3) and therefore serve
different purposes. title is purely optional, but alt is
mandatory and should always be helpful. Note that the spec
doesn't say what UA's must or even should do with the title
attribute either.

--
....also, I submit that we all must honourably commit seppuku
right now rather than serve the Dark Side by producing the
HTML 5 spec.
 
Reply With Quote
 
mark4asp
Guest
Posts: n/a
 
      01-08-2008
mark4asp wrote:

> The empty alt tag is still needed because I want to use xhtml markup.
> However now my <asp:Image> [asp.net] tags are broke because when I
> when I specify them as <asp:Image AlternateText ="" ... /> they are
> rendered as <asp:Image ... /> i.e. with no alt tag at all.
>

Sorry I meant to say:

they are rendered as <img ... /> i.e. with no alt tag at all.


 
Reply With Quote
 
mark4asp
Guest
Posts: n/a
 
      01-08-2008
Johannes Koch wrote:

> mark4asp schrieb:
> ><image alt="blah blah" ... /> - what should it look like?

>
> Don't know. In XHTML there is no image element, it's called img. The
> img element's alt attribute is an alternative for the image, to be
> rendered if the image itself is not rendered (e.g. in a text browser,
> a screen reader or voice browser, or when image rendereing is
> disabled in a graphical browser). If you want a tooltip, you may get
> it when adding a title attribute to the img element.


So you're saying that this is not fully dealt with in the xhtml
specification? So that the various browser vendors can handle the alt
value as they wish to? But in that case why does an <img> tag have to
include an alt attribute - given that xhtml does care how (or even)
whether the alt value rendered. That just seems daft to me.
 
Reply With Quote
 
Johannes Koch
Guest
Posts: n/a
 
      01-08-2008
Xpost and F'up comp.infosystems.www.authoring.html

mark4asp schrieb:
> Johannes Koch wrote:
>
>> mark4asp schrieb:
>>> <image alt="blah blah" ... /> - what should it look like?

>> Don't know. In XHTML there is no image element, it's called img. The
>> img element's alt attribute is an alternative for the image, to be
>> rendered if the image itself is not rendered (e.g. in a text browser,
>> a screen reader or voice browser, or when image rendereing is
>> disabled in a graphical browser). If you want a tooltip, you may get
>> it when adding a title attribute to the img element.

>
> So you're saying that this is not fully dealt with in the xhtml
> specification? So that the various browser vendors can handle the alt
> value as they wish to?


<http://www.w3.org/TR/html4/struct/objects.html#adef-alt>:
alt = text [CS]
For user agents that cannot display images, forms, or applets, this
attribute specifies alternate text. The language of the alternate text
is specified by the lang attribute.

> But in that case why does an <img> tag have to
> include an alt attribute -


Because not every browser can or will render the image itself. So a
textual alternative is needed to be rendered instead.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      01-08-2008
According to HTML specs alt tag is used to show the picture's place when
picture is not available (yet).

So while browser still loading picture from the server the alt content will
be shown to user so people with slow internet connection can get an idea
what they are going to be looking at soon

PS: First time I hear that firefox shows alt on top of the image. May be
it's a setting in Firefox and you have it turned on because it's not the
case usually.

PPS: IE support tooltip attribute I believe. And I guess when it's not
available it shows alt as a tool tip.

George.

"mark4asp" <> wrote in message
news:4783548b$0$20530$...
> <image alt="blah blah" ... /> - what should it look like?
>
> When I use <image alt="blah blah" ... />
>
> The alt value of an image tag is rendered inconsistently:
> * In Safari I see nothing. The alt value is ignored.
> * In IE6 I see a tooltip
> * In Firefox the alt attribute value is displayed on top of the image.
> With a small image the text overflows to the rhs.
> * In Opera the actual the alt attribute value is displayed on top of
> the image. With a small image the text is trucated within the width
> specified for the image.
>
> What's going on here? Do 3/4 of these browsers have bugs or is the
> xhtml specification missing something?
>
> The only sensible solution to this is for me to use blank alt tags
> <image alt="" ... /> and to use a title attribute instead.
>
> The empty alt tag is still needed because I want to use xhtml markup.
> However now my <asp:Image> [asp.net] tags are broke because when I when
> I specify them as <asp:Image AlternateText ="" ... /> they are rendered
> as <asp:Image ... /> i.e. with no alt tag at all.
>
>
> [FireFox 2.0.0.11, Opera 9.25, Build 8827, Safari 3.0.4 (523.13), IE 6
> sp6 (with latest updates) all running on WinXP sp2 with latest updates
> on asp.net 2 site using ms ajax.]
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use a look-ahead and a look-behind at the same time? dan.j.weber@gmail.com Perl Misc 4 04-09-2008 10:25 PM
have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much)have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much) justpratik Python 0 06-08-2007 04:48 AM
Why do look-ahead and look-behind have to be fixed-width patterns? inhahe Python 3 01-28-2005 12:50 PM
<tr> with a 1x1 image as a filler on a table with padding of 2 look thicker in netscape but they look ok in IE. Serial # 19781010 HTML 1 08-10-2003 09:05 PM
Re: What should I look for in a DVD player? Bhoona Computer Support 1 07-11-2003 10:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57