0
<h2 title="Site Owner">Mr. Mark </h2>

Is it possible to edit/style the HTML title (works like a tool-tip) attribute as illustrated above with CSS?

I tried styling it with inline css but it's not coming through.

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
  • 1
    Not possible to style `title` attribute, but possible to replace it with custom element. You'd need to share the relevant code pieces to get help. – Robo Robok Feb 04 '23 at 21:52
  • 1
    You must mean the [`title` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title), because a ["tittle"](https://merriam-webster.com/dictionary/tittle) is a diacritic mark like the dot above the lowercase _i_ or _j_. – Oskar Grosser Feb 04 '23 at 23:05
  • Does this answer your question? [How to change the style of the title attribute inside an anchor tag?](https://stackoverflow.com/questions/2011142/how-to-change-the-style-of-the-title-attribute-inside-an-anchor-tag) – Zeikman Feb 05 '23 at 12:39

2 Answers2

0

Yes, you will need a [title]:hover::after rule as below:

h2[title]:hover::after {
  content: attr(title);
  position: absolute;
  color: red;
  top: 200;
  left: 200;
}
<h2 title="Site Owner">Mr. Mark </h2>
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
-2
<span title="file 1"> Files</span>
a[title]:hover::after {content: attr(title);position: absolute;top: -100%;left:0;}
  • 4
    Please add an explanation as to what you are doing. As apparent by their question, the questioner doesn't seem to have much experience in HTML nor in CSS. – Oskar Grosser Feb 04 '23 at 22:59