Click to See Complete Forum and Search --> : img "alt" style ??


liccy
05-05-2008, 09:08 AM
Hi there...

I was thinking is someone know about away to style the "alt" from a img tag...

Thanks

WebJoel
05-05-2008, 09:16 AM
Can you explain what you want? I do not understand the request.

liccy
05-05-2008, 09:29 AM
well i have a image that have a "alt" attribute... But I would like to style the color, size and so on for the same ... that ways if the img is no displaying the alt will be visible...

Let me know if that make it clear.

Thanks

dtm32236
05-05-2008, 09:56 AM
as far as I know you can't style an alt tag

A1ien51
05-05-2008, 10:10 AM
YOu cannot style the alt tag, that is based on the browser/computer display settings. If you want to change it, you would have to either manually change them settings [do not think that is an option!] or look into using JavaScript tooltips or live with the default colors.

Eric

felgall
05-05-2008, 03:24 PM
The alt provides plain text to put in place of the image where the image can't be displayed. As such it can be styled by applying the styles that you want to whatever element that you have that contains the image.

<span class="xyz"><img></span>

simply apply the font etc to the xyz class and with this code your alt text will be styled appropriately when the image isn't displayed.

dtm32236
05-05-2008, 04:05 PM
The alt provides plain text to put in place of the image where the image can't be displayed. As such it can be styled by applying the styles that you want to whatever element that you have that contains the image.

<span class="xyz"><img></span>

simply apply the font etc to the xyz class and with this code your alt text will be styled appropriately when the image isn't displayed.

really? cool...

I didn't think that would work. Thanks for the tip Felgall.

WebJoel
05-05-2008, 09:51 PM
Now I understand your request (I had wrongly thought you wanted to have alt="" be 'external' in a CSS document or something which would not happen, as alt="" is "content", not "presentation" and it belongs IN the HTML document).,
And, the excellent follow-up posts fully explain the how~to/s so I have nothing to add. :)