Roedy Green wrote:
I want to set up links to photos marked with camera icon.
I would like it if I could replace code like this:
<a href="images/roedy.jpg"><img src="images/camera.gif" width="29"
height="24" border="0" alt="photo"></a>
With code like this:
<span class="photo">"images/roedy.jpg"</span>
How close can I get, and what does the .photo style sheet entry look
like?
There is no way to make a link without an <a> tag.
You could get rid of the <img> tag (assuming that it is the same icon for
all tags), by setting it as the links background-image in CSS. In order to
keep accessability, there should be some content in the <a> tag, like
<a class="photo" href="images/roedy.jpg">show photo</a>.
If the <a> can be styles as a block element (depends on your layout), than
you can get rid of the text completely by using an image replacement
technique, e.g.
..photo {
display: block;
text-indent: -2000em; /* move text far out of visible area */
background-image: url(images/camera.gif);
width: 16px; height: 16px;
}
If the <a> must be inline, you can at least add the icon to the text
..photo {
padding-left: 20px; /* add some space at the left for icon */
background-image: url(images/camera.gif);
background-repeat: no-repeat;
}
(I don't know, if you could hide the text completely for inline elements...
would text-indent work, too??)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW:
http://www.odahoda.de/