Cartoper wrote:
On Sep 22, 7:30 pm, "Chris F.A. Johnson" <cfajohn...@gmail.comwrote:
> CSS is for presentation, not content. You cannot do it with CSS
unless you want it to be a background image.
Exactly, I am trying to figure out how to make it the background image
of the link. What I am trying to do is move all the presentation
formatting to the CSS, including the images. The ultimate objective
is to be able to change the CSS file and change the whole theming of
the site.
Wrong approach.
Your `img' element requires an (here: non-empty) `alt' attribute value in
either case, for validity and accessibility. Which clearly indicates that
an image that is the content of an a[href] element is not presentational, it
is content. You will have to replace that content with something else if
you use a background image, because otherwise that link will no longer be
accessible for people and ignored by search engines. (There is no way to
specify a textual alternative for background images.)
But if you use text and a background image, it is likely that you will run
into accessibility issues in the case CSS is supported and the
"presentational" background image can be perceived by the user (e.g. bad
contrast and scaled fonts).
And if you put the text into the image and make the content transparent to
avoid that, it is not unlikely that this will be (mis)recognized by search
engines as an attempt to trick them, therefore being ignored as well and
your site maybe blacklisted.
So you you better stick with the `img' element, and provide the `alt'
attribute. And if theming is an issue, there is server-side scripting.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>