Hover over images and display text
-
I’m using the Regulus theme (I’m not sure if that is relevant) and I simply want to have some text displayed when you hover over an image. Usually I simply use the title=”text here” here in this format:
<img src=”image.gif” title=”text here”>
This works when I switch it to the Visual tab but as soon as I save it, the title=”text here” bit in the code disappears. Using the alt=”text here” does stay there once saved but that doesn’t allow text when hovering over an image.
What can I do to get around this and simply have text when I hover over an image?
-
In the code tab, replace the image’s alt text (by default, it’s the filename again) with whatever text you’d like. You said it doesn’t work – have you tried it with a published post? It usually shows up for me in preview, but not always.
-
-
-
You’re using Firefox, aren’t you? If you were to view the blog in Internet Explorer, the alt attribute would display the text. It isn’t how it’s supposed to work, but that’s Microsoft for you.
The way you propose is correct, but doesn’t work at wordpress.com. I don’t know of a workaround on wordpress.com blogs.
-
pipsqueak, the title attribute also works on Firefox. It works also on wordpress.com.
The alt attribute is actually supposed to be an alternative text for pictures, which displays when pictures are not loaded or is used by text-only browsers to describe what should appear as a picture. Some browsers in the past used to display it as a tooltip, but the great majority of modern browser don’t. Title is the attribute to choose for tooltips.
-
isadora, I agree with you that the title attribute is the correct one to use, but I’ve used it on pictures in my posts on wordpress.com in the past and it was stripped out every time, exactly like the OP’s talking about. I know because I fought with it for a couple weeks last summer before finally giving up.
All we’re left with at wordpress.com is the alt attribute, which (correctly) doesn’t display as a tooltip in Firefox. Internet Explorer 7, the most popular browser and the browser that most people on wordpress.com probably use, displays the alt attribute as a tooltip.
If the OP is using Firefox to view his blog, he won’t see the tooltip.
-
- The topic ‘Hover over images and display text’ is closed to new replies.