Forum Moderators: not2easy

Message Too Old, No Replies

Add image alt tag by using CSS code

         

2010_Movies

9:41 am on Dec 5, 2011 (gmt 0)

10+ Year Member



Have there any way to add image alt tag by using CSS code? I can do it in HTML but not in CSS.
Please help me.

penders

10:22 am on Dec 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can not influence the ALT attribute using CSS. You could perhaps add this with JavaScript, but it's not going to be particularly accessible or SE friendly. The ALT text needs to be hard coded in the HTML.

alt131

2:43 pm on Dec 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi 2010_Movies, I guess my question is why are you trying to set the alt via css? Put another way, what is the coding situation that means you cannot hard-code the alt into the html?