2011-11-29 14:00, dave higgs wrote:

Although I do use an external style sheet, the
suspect HTML code does not have any CSS applied to it so I am in the
wrong list!

The question was on-topic in the list as it was about a presentational feature, and although CSS did not create the problem, it can solve it.

(I guess people may have been confused because you mentioned the use of JavaScript and quoted a block of JavaScript code. That code does not relate to the question; it's functionality, not presentation, and the issue is exactly the same if JavaScript execution is disabled.)

Although the borders around an image that is a link _can_ be removed using HTML, too (using the attribute border=0 in each <img> tag), the CSS way (img { border: 0 }) is simpler and keeps the markup cleaner.

A completely different approach would be to replace the images by styled text, using a background image for the texts. The image would then be like the current images but without any text (and similarly for the hover version). There would be no image border issue then. There would be the issue of link colors and underline for the texts, but they can be handled easily in CSS.

Such a technique is usually better because it is more flexible. If you wish to change some of texts in the links or add a link, you wouldn't need to edit any images. And there is no alt text issue (now there is - your <img> tags are missing alt attributes). The drawback (if it is a drawback) is that you could only use such fonts that are supported by people's browsers (or use web fonts, @font face), and if users force their preferences on fonts sizes (which is what they _can_ do), the texts might run out of button-like image backgrounds.

Yucca
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to