Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: Using a Span for Hover Info

$
0
0

Hi there.

Unfortunately, there is no "info" attribute for the "span" element.
http://www.w3.org/wiki/HTML/Elements/span

--

Also, TinyMCE (the HTML editor) discards every attribute and element which is not defined in its config.
http://www.tinymce.com/wiki.php/Configuration:valid_elements

--

Try a html5 custom data-* attribute instead:

<span data-info="some content to pop up on hover">Copy That Is Hovered Over</span>

span[data-info]:hover:after {
content: attr(data-info);
padding: 4px 8px;
// ...


http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#custom-data-attribute

--

Normally I use jQueryUI's Tooltip plugin. It has a lot of features and allows you to use common "title" attributes for non-javascript and SEO purposes.
http://jqueryui.com/tooltip/


Posted to: Using a Span for Hover Info | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles