In the last article, we learned about dropdown menus using CSS. It uses very simple concepts like pseudo-classes, display property in CSS and HTML lists. Today using same concepts, we are going to create tooltips. Tooltips are used for giving user extra information about a hovered item like buttons, links or any other text or images. Let's begin... Create Basic Tooltip Important points to note: Create div containing text to hover inside which another div containing text to be shown after hovering Initially hide the content of second div using visibility property Use :hover pseudo-class on the first div to change visibility property of the second d iv Create tooltip example yourself before looking the code... See the Pen WDS64-1 by blackbird ( @blackbird98 ) on CodePen . Position Tooltips In the previous example, the tooltip was positioned on left, but we can change position as per our choice. We can do this by setting left, right, top and bottom properties on
The blog to help programmers to learn, experiment and understand new concepts.