homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Add image alt tag by using CSS code

Msg#: 4394304 posted 9:41 am on Dec 5, 2011 (gmt 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.



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

Msg#: 4394304 posted 10:22 am on Dec 5, 2011 (gmt 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.


WebmasterWorld Senior Member 5+ Year Member

Msg#: 4394304 posted 2:43 pm on Dec 6, 2011 (gmt 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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved