Create tooltips on CSS
Creation, development, manufacturing sites | WEB-STYDIA.COM

Good day dear user, today I would like to talk about how to create a tooltip text using CSS, well, and create a few examples.

And so what the "tooltips" - is the text or image that appears when you hover the mouse pointer over the link or some other element of the page, if the title attribute is its description.

Tooltips can be used for reference, and for any images.

In the usual form without issuing a clue about this kind of as in the photo below:

And it shows the standard system by using the title attribute, without registration of the code of the tooltip is as follows:

But as we said initially, we will make these tooltips prettier, and will use the css code, today we will consider three options for tooltips.

Since it is not possible in a simple CSS design title, so we will add different attributes to write for them clearance and accordingly add them to the code of our links or images for which we do pretty tooltip.

Option tooltip first, and in it we will add a hint on the photo at the bottom when the mouse pointer.

To perform this operation, we will use two attributes: image, and in order to help our working after and data-text to display the tooltip text.

Example of CSS styles for this version of the tooltip:

And the HTML code looks like this:

But about such a result, we get:

But this option links the tooltip will not work of course, mean we will use slightly different methods of withdrawal of our tips. In the first method, we derive a tooltip is over our link.

CSS code sample below:

And for our links with prompt do the following code:

And the result we get is this:


Move your mouse over here

And the last third option - Per our tooltip will be a reference, in principle, it is similar to the previous but slightly different design and output a reference.

Example CSS code:

Well and, accordingly, the html-code for the link:

And you will have to get a result as in the example below:


Move your mouse over hereThe text of the tooltip

So we looked at three options for tooltips, like nothing complicated but our tooltips already have a nice view of what was originally their course in the network much more can be found and it is only a small part of the examples on this try and comment on.

You may also like

No Comment

You can post first response comment.

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter a message.