Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: not2easy

Message Too Old, No Replies

Add image alt tag by using CSS code

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

New User

joined:Dec 5, 2011
posts: 2
votes: 0


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.
10:22 am on Dec 5, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


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.
2:43 pm on Dec 6, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Aug 9, 2008
posts: 961
votes: 0


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?