Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to apply style to 'title' attribute of 'td' tag

Tags:

html

css

I have the following code with me, and would like to customize the style of the 'title' attribute. Is there any way to do it. Thanks in advance.

<td title="Sample Title">test</td>
like image 289
Jagadeesh Avatar asked May 09 '12 11:05

Jagadeesh


1 Answers

This may not have been possible many years ago - but now yes you can style the Title attribute, See here . This should work in IE7+, Safari 3+, Firefox 2.0+.

Some custom styling and positioning may be required to suite your own design.

Just to make sure this link does not go dead, the suggested code in this article to style the title attribute is:

<div title="Tooltip text for first div"></div> <div title="Tooltip text for second div"></div>

div:before{ content:attr(title); display:none; }

div:hover::before{ width:200px; display:block; background:yellow; border:1px solid black; padding:8px; margin:25px 0 0 10px; }

div:hover{ z-index:10; position:relative; }
like image 111
BMac Avatar answered Sep 30 '22 16:09

BMac