Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the size of html title tag

Tags:

html

I have a following html code

<a href="www.example.com" title="example">Link</a>

what i want is to change the size background color and other properties of title. is it possible?

like image 219
Bloodhound Avatar asked Mar 16 '23 11:03

Bloodhound


1 Answers

I don't think you can style the title, but you can emulate its functionality by using a data attribute with a CSS :after pseudo-element on hover:

a {
  position: relative;
}

a:hover:after {
  content: attr(data-title);
  position: absolute;
  font: 10px verdana;
  top: -110%;
  left: 0;
  background: #ace;
  color: black;
  box-sizing: border-box;
  border: 1px solid gray;
  border-radius: 20%;
  padding: 3px;
}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<a href="www.example.com" data-title="example">Link</a>
like image 52
Rick Hitchcock Avatar answered Mar 23 '23 12:03

Rick Hitchcock