I need some help. How can I manage a title of a hyperlink for example if I got a hyperlink like this
<a href="#" title="Hello">Press here</a>
How can I change the font and the size of the word 'Hello'?
I need some help. How can I manage a title of a hyperlink for example if I got a hyperlink like this
<a href="#" title="Hello">Press here</a>
How can I change the font and the size of the word 'Hello'?
You can use a[data-title]:hover
to style it (instead of title
).
Example:
<a href="#" data-title="Nice CSS title">Test</a>
a {
color: #900;
text-decoration: none;
}
a:hover {
color: red;
position: relative;
}
a[data-title]:hover:after {
content: attr(data-title);
padding: 4px 8px;
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 20px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
Well, you can't it's a browser default .. however what you can do is use a small jQuery plugin for tooltips & you will have total control over the look of the elements appearing on hover. Check this link for example
Hy, you can't change the styling of Title attribute inside a tag. I mean you can but there's some browser incompatibilities. I think the best solution is that you make a specific class for that a tag and inside that a tag put span. Something like this:
<a href="#" class="pop">Press here <span>Hello</span></a>
a.pop {
color: blue;
text-decoration: none;
position: relative
}
a.pop:hover {
text-decoration: underline;
}
a.pop span {
display:none;
}
a.pop:hover span {
display: block;
position: absolute;
left:0;
z-index:100;
background: grey;
padding: 5px 10px;
font-size:13px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
text-decoration: none;
}