Re: Can I set a different style for <a title="" /> or <img title="" />?
On 2008-03-16, Lorenzo De Tomasi <lorenzo.detomasi@gmail.com> wrote:
> Ciao,
>
> In <a href="http://index.html" title="Go to the homepage">Homepage</a>
> or in
><img src="paris.jpg" alt="Two children running in front of the Eiffel
> tower" title="Paris, 2008">,
>
> using only css, I would like to set a different text-color or
> background-color for the 'title box' that appears when i do a rollover
> on the link or the image (Firefox default is a black text on a yellow
> background box).
>
> Is it possible?
The 'title box' is part of the browser and not standard. You can't style
it per se. But you can make your own title box, something like this:
a { position: relative }
.popup
{
position: absolute;
top: 1em;
left: 1em;
background-color: palegreen;
color: red;
visibility: hidden;
white-space: nowrap;
border: 1px solid green;
}
a:hover .popup { visibility: visible }
...
<a href="#">Homepage<span class="popup">Go to the homepage</span></a>
May not work in IE.
|