Not having to type 'alt=""' in every link?

P

(Pete Cresswell)

I've got a list of several hundred links whose code would look a little cleaner
if it didn't have to contain 'alt=""' for every img element.

Seems like something that could be covered in <base>, but I can't make it work.

e.g.
 
L

Leif K-Brooks

(Pete Cresswell) said:
I've got a list of several hundred links whose code would look a little cleaner
if it didn't have to contain 'alt=""' for every img element.

Setting alt="" may be useful for some decorative images, but why are you
setting it for linked images? How do you expect users with voice or text
browsers to use the links when you haven't provided any alternate text?
 
D

David Dorward

(Pete Cresswell) said:
I've got a list of several hundred links whose code would look a little
cleaner if it didn't have to contain 'alt=""' for every img element.

I'm guessing that either you are using decorative images, in which case you
might consider setting a non-repeating background image and some padding on
the links (or using an image for the bullets in an unordered list), or you
are using images which are relevant to the link destination and should have
non-empty alternative content.
 
M

Michael Winter

I've got a list of several hundred links whose code would look a little
cleaner if it didn't have to contain 'alt=""' for every img element.

Having no alt text for every image on a page seems very wrong to me. Even,
perhaps especially, if they are link banners, they could at least contain
the name of the linked site.
Seems like something that could be covered in <base>, but I can't make
it work.

You don't seem to understand what the base element is for. It specifies
the base URL for the document, used by the user agent to resolve relative
addresses. In the Transitional and Frameset DTDs, it also indicates the
default link target. It isn't for specifying any old default value, and it
certainly doesn't have an alt attribute.

[snip]
<base target="showframe" alt="" />

Are you writing XHTML? If not, don't include the slash.

[snip]

Mike
 
P

(Pete Cresswell)

RE/
but why are you
setting it for linked images? How do you expect users with voice or text
browsers to use the links when you haven't provided any alternate text?

Validator.w3 seems to require it. In spite of much expert advice to the
contrary, I'm still using a frame for the index. Reason: what I was able to
read about why frames are evil mostly revolved around their defeating the nature
of the web by compromising the bookmarkability of pages. In this case, the
pages are imprisoned in a CD that people are reading in their local drive - so
those reasons didn't seem to apply.

Besides, I'm going on a wing and a prayer here and Frames are working.... Once I
climb the learning curve a little more, I'll look for alternative ways to
present a scrolling list of hundreds of links without having the top of the page
disappear from view...but for now....

I don't need an 'alt' address because the whole thing is on a CD - so the images
are guaranteed to be there.

There are hundreds of thumbnail images, that comprise a list of pictures that
can be viewed.

A few:

---------------------
<div class="navlist">
<p><a href="Pix\45th\DSCN9178.JPG"><img src="Pix\45th\ThumbNails\DSCN9178.jpg"
alt=""/><br/>DSCN9178.JPG</a></p>
<p><a href="Pix\45th\DSCN9179.JPG"><img src="Pix\45th\ThumbNails\DSCN9179.jpg"
alt=""/><br/>DSCN9179.JPG</a></p>
<p><a href="Pix\45th\r01-03.jpg"><img src="Pix\45th\ThumbNails\r01-03.jpg"
alt=""/><br/>r01-03.jpg</a></p>
<p><a href="Pix\45th\r01-04.jpg"><img src="Pix\45th\ThumbNails\r01-04.jpg"
title="Our Entertainers" alt=""/><br/>r01-04.jpg</a></p>
<p><a href="Pix\45th\r01-05.jpg"><img src="Pix\45th\ThumbNails\r01-05.jpg"
alt=""/><br/>r01-05.jpg</a></p>
<p><a href="Pix\45th\r01-06.jpg"><img src="Pix\45th\ThumbNails\r01-06.jpg"
alt=""/><br/>r01-06.jpg</a></p>
<p><a href="Pix\45th\r01-07.jpg"><img src="Pix\45th\ThumbNails\r01-07.jpg"
title="Blake Tomlinson" alt=""/><br/>r01-07.jpg</a></p>
<p><a href="Pix\45th\r01-08.jpg"><img src="Pix\45th\ThumbNails\r01-08.jpg"
title="Goodrich, Miller, Anderson, Adams" alt=""/><br/>r01-08.jpg</a></p>
<p><a href="Pix\45th\r01-09.jpg"><img src="Pix\45th\ThumbNails\r01-09.jpg"
title="Schneeweis" alt=""/><br/>r01-09.jpg</a></p>
<p><a href="Pix\45th\r01-10.jpg"><img src="Pix\45th\ThumbNails\r01-10.jpg"
alt=""/><br/>r01-10.jpg</a></p>
......
</div>
 
D

David Dorward

Validator.w3 seems to require it.

It doesn't. The HTML standard you claim to use requires it, the validator
just tells you this.
In spite of much expert advice to the
contrary, I'm still using a frame for the index. Reason: what I was able
to read about why frames are evil mostly revolved around their defeating
the nature of the web by compromising the bookmarkability of pages. In
this case, the pages are imprisoned in a CD that people are reading in
their local drive - so those reasons didn't seem to apply.

Why not? I've got more then a few bookmarks to resources stored locally.
Besides, I'm going on a wing and a prayer here and Frames are working.

.... working in your test environment.
I don't need an 'alt' address because the whole thing is on a CD - so the
images are guaranteed to be there.

Is the user guaranteed to be using a graphical browser?
Is the user guaranteed to have eyesight good enough to see the images?
<div class="navlist">
<p><a href="Pix\45th\DSCN9178.JPG"><img
src="Pix\45th\ThumbNails\DSCN9178.jpg"
alt=""/><br/>DSCN9178.JPG</a></p>

That doesn't look like a paragraph, it looks more like a list item. Your
slashes are backwards. You are using XHTML, but failing to follow the HTML
compatibility guidelines. I think a caption is likely to be more useful to
the user then the filename.
 
M

Michael Winter

[snip]
I don't need an 'alt' address [...]

I'm curious to know if you meant that last word. The alt attribute doesn't
specify an address, it specifies replacement text to display if the image
cannot be rendered (for whatever the reason - some are below).

There are few reasons to specify no alt text. The only one I can think of
at the moment is that the image in question is purely decorative. As it
isn't content, who cares if it isn't rendered?
so the images are guaranteed to be there.

Alternative text isn't displayed just because the resource cannot be
found. It's also rendered by text browsers, when the user disables image
display, or if the browser cannot display that particular image format.
Braille readers need alt text, too (for obvious reasons).

[snip]

Mike
 
P

(Pete Cresswell)

RE/
I'm curious to know if you meant that last word. The alt attribute doesn't
specify an address, it specifies replacement text to display if the image
cannot be rendered (for whatever the reason - some are below).

It was pure ignorance. I had just read about "text" and figured "alt" must be
something like "Alternative Address Reference".
Alternative text isn't displayed just because the resource cannot be
found. It's also rendered by text browsers, when the user disables image
display, or if the browser cannot display that particular image format.
Braille readers need alt text, too (for obvious reasons).

I think my brain is going on overload....
 
P

(Pete Cresswell)

RE/
... working in your test environment.

Good catch. I just got back from dinner at a friend's house. They have a Mac
and my little house of cards collapsed - unable to resolve the file references.
Is the user guaranteed to be using a graphical browser?
Is the user guaranteed to have eyesight good enough to see the images?

As above...
That doesn't look like a paragraph, it looks more like a list item. Your
slashes are backwards. You are using XHTML, but failing to follow the HTML
compatibility guidelines. I think a caption is likely to be more useful to
the user then the filename.

I'm going on a wing and a prayer here. First exposure to HTML was a couple
days ago.... What I wanted was for each link (i.e. the thumbnail and the file
name) TB stacked vertically. The List format *sounds* more appropriate. I'll
give it a try and see if it buys me anything presentation-wise.


My fingers/lower brain stem were following Windows path naming conventions...
maybe this is the answer to why it failed on the Mac...

The caption serves me more than the the user. The idea is that a user might
request an "original" of the picture (not knowing that that .JPEG exists right
on the CD) and if they are forced to ask by name, it makes it easier to steer
them to it or, if that seems like fighting nature, just email them the .JPEG.
 
K

Karl Core

(Pete Cresswell) said:
RE/

It was pure ignorance. I had just read about "text" and figured "alt"
must be
something like "Alternative Address Reference".

It is for this reason that you should familiarize yourself with the basics
before coming to a newsgroup to ask such questions.
Regular posters to usenet newsgroups such as this don't have a very
favorable response to newbies who ask questions that can be answered quite
easily by doing your own legwork beforehand.

-Karl
 
N

Neal

I'm going on a wing and a prayer here. First exposure to HTML was a
couple
days ago....

I remember those days. Don't be offended when i say it's a long, long road
and you have a lot of work to do!
What I wanted was for each link (i.e. the thumbnail and the file
name) TB stacked vertically. The List format *sounds* more
appropriate. I'll
give it a try and see if it buys me anything presentation-wise.

Don't even worry about presentation in HTML. Use HTML to describe what the
text IS. Then use CSS to manipulate the presentation. I mean it. Avoid the
mistakes I've made, please.
My fingers/lower brain stem were following Windows path naming
conventions...
maybe this is the answer to why it failed on the Mac...

The caption serves me more than the the user. The idea is that a user
might
request an "original" of the picture (not knowing that that .JPEG exists
right
on the CD) and if they are forced to ask by name, it makes it easier to
steer
them to it or, if that seems like fighting nature, just email them the
.JPEG.

Well, you can make that available. The alt text should, still, be a
replacement for that odd time when a user cannot see the image.
 
P

(Pete Cresswell)

RE/
Don't even worry about presentation in HTML. Use HTML to describe what the
text IS. Then use CSS to manipulate the presentation. I mean it. Avoid the
mistakes I've made, please.

After reading various posts here, I've committed to two things:

1) Using CSS exclusively.

2) Getting all my code past the W3 Validators.

Well, you can make that available. The alt text should, still, be a
replacement for that odd time when a user cannot see the image.

I think I'll just rewrite the VB routine that generates those links so it plugs
the file path into 'alt='.
 
L

Leif K-Brooks

(Pete Cresswell) said:
I think I'll just rewrite the VB routine that generates those links so it plugs
the file path into 'alt='.

How will that replace the contents of the image?
 
N

Neal

I think I'll just rewrite the VB routine that generates those links so
it plugs
the file path into 'alt='.

Better - reserve alt for its purpose, and insert as a sort of caption to
the image the filename and other pertinents. You can also include that in
the title, though users can't copy and paste it from there so easily.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top