Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Foundation Tooltip

Foundation Tooltip

A tooltip is displayed when the mouse moves over an element:

We can add a data-tooltip attribute to any element to create a tooltip. Use title attribute to set the tooltip's text.

Note: The slider requires JavaScript. So you need to initialize Foundation JS:

Example

<

span

data-tooltip title=

"Hooray!"

Hover over me!

<

/span

<

script

$(document).ready(function() {

    $(document).foundation();

})

<

/script

Try it »

.has-tip class can bold the text the mouse moves over:

Example

<

span

data-tooltip class=

"has-tip"

title=

"Hooray!"

Hover over me!

<

/span

Try it »


Tooltip display position

By default, the tooltip appears at the bottom of the element.

You can use the .tip-top, .tip-left, .tip-right or .tip-bottom (default) to set the tooltip's position.

Note: On small screens, the tooltip's width is 100%.

Example

<

span

data-tooltip class=

"has-tip tip-top"

title=

"Hooray!"

Top

<

/span

<

span

data-tooltip class=

"has-tip tip-bottom"

title=

"Hooray!"

Bottom

<

/span

<

span

data-tooltip class=

"has-tip tip-left"

title=

"Hooray!"

Left

<

/span

<

span

data-tooltip class=

"has-tip tip-right"

title=

"Hooray!"

Right

<

/span

Try it »


Rounded tooltip

.radius and .round class is used to set a rounded tooltip:

Example

<

span

data-tooltip class=

"has-tip"

title=

"Hooray!"

Default

<

/span

<

span

data-tooltip class=

"has-tip radius"

title=

"Hooray!"

Radius

<

/span

<

span

data-tooltip class=

"has-tip round"

title=

"Hooray!"

Round

<

/span

Try it »