Afficher un message
Vieux 16/03/2008, 11h05   #2
Ben C
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
 
Page generated in 0,05192 seconds with 9 queries