Alt tag in css tylesheet??

liunx

Guest
I have several divs with background urls... Is there a way to have an alt tag in the CSS stylesheet so a description pops up with a mouseover?No. And further, the alt attribute is to supply alternate text for images, for non-graphical browsers, or when the image is not available. IE, unfortunatly, seems to think the alt attribute is the title attribute. If you want the little description box, use the title attribute -- that's what it's for.And the title attribute can be used in the CSS stylesheet? How is it supposed to look?Neither attribute are css -- they are HTML attributes.

<div title="foo">blah</div>

<img src=http://www.webdeveloper.com/forum/archive/index.php/"foo.png" width="50" height="50" alt="description of foo.png">Okay, so it can't be done in just the stylesheet then.

What I want to do is something like this:

div.abc {
background:url(blahblah.jpg) alt="tootiefruitie"
}

Is there a way to do this? I don't want to access the html file at all. I want to be able to do everything from the stylesheet.No, you can not set the alt attribute via css.And there is no way to do anything like that? With a description popup?I fail to see why you can not just put it into your markup. :confused:I could, but I want to put it in the stylesheet. It's not a big deal, I can put it in the markup or just leave it out entirely. Thanks though.Sure thing...The answer was yes you could have used CSS to display alternative text (not how you had it though) in most circumstances it is best left to the mark-up and title attribute.

But it is impossible to use the CSS style sheet to do everything, though XSLT is probably the nearest you'll get to that scenario.
 
Back
Top