0

What's the simplest way to change the title attribute font size?

aF.
  • 64,980
  • 43
  • 135
  • 198
  • possible duplicate of [Is it possible to format an HTML tooltip?](http://stackoverflow.com/questions/484137/is-it-possible-to-format-an-html-tooltip) – Jukka K. Korpela Feb 22 '13 at 18:47

1 Answers1

4

You can't : the title attributes are displayed in an system specific and non HTML way.

To tune how they look, you'll have to build and display your own divs on mouse hovering (or use an existing "bubble" library).


On request :

Here's a minimal "bubble" library, using jQuery :

$('[data-bubble]').hover(function(e){
  if (window.bubble) window.bubble.remove();
  bubble = $('<div>', {
    text: $(this).data('bubble'),
    css: {
      position:'fixed',
      top:e.pageY, left:e.pageX,
      background:'yellow'
    }
  }).appendTo(document.body);
}, function(){
  window.bubble.remove();
});

Usage :

<span data-bubble="some Text">HOVER THIS</span>  

Demonstration

I'll let you do the syling you like. If you don't use jQuery, I let you port it to vanilla-js, I think you get the idea.

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758