search

Home  >  Q&A  >  body text

Can the HTML title attribute be edited?

1

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

Is it possible to edit/set the HTML title (works like a tooltip) property using CSS, as shown above?

I tried styling it using inline CSS but it didn't go through.

P粉277305212P粉277305212374 days ago493

reply all(1)I'll reply

  • P粉098979048

    P粉0989790482024-02-26 00:33:04

    Yes, you will need the [title]:hover::after rule like this:

    1

    2

    3

    4

    5

    6

    7

    h2[title]:hover::after {

      content: attr(title);

      position: absolute;

      color: red;

      top: 200;

      left: 200;

    }

    1

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

    reply
    0
  • Cancelreply