/    Sign up×
Community /Pin to ProfileBookmark

img "alt" style ??

Hi there…

I was thinking is someone know about away to style the “alt” from a img tag…

Thanks

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelMay 05.2008 — Can you explain what you want? I do not understand the request.
Copy linkTweet thisAlerts:
@liccyauthorMay 05.2008 — 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
Copy linkTweet thisAlerts:
@dtm32236May 05.2008 — as far as I know you can't style an alt tag
Copy linkTweet thisAlerts:
@A1ien51May 05.2008 — 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
Copy linkTweet thisAlerts:
@felgallMay 05.2008 — 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.
Copy linkTweet thisAlerts:
@dtm32236May 05.2008 — 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.[/QUOTE]


really? cool...

I didn't think that would work. Thanks for the tip Felgall.
Copy linkTweet thisAlerts:
@WebJoelMay 06.2008 — 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 [I]IN[/I] the HTML document).,

And, the excellent follow-up posts fully explain the how~to/s so I have nothing to add. ?
×

Success!

Help @liccy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...