English 中文(简体)
W3.CSS - Tooltips
  • 时间:2024-09-17

W3.CSS - Tooltips


Previous Page Next Page  

W3.CSS supports a different kind of tooltip using w3-tooltip class. Take a look at the following example. Here we ve put a tooltiptext within a span and an image and appped w3- tooltip on the parent span.

<span class = "w3-tooltip">
   <span class = "w3-text w3-container w3-teal" style = "width:255px;">
      <p>Learn HTML5 in simply easy way @TutorialsPoint.com</p>
   </span>
   <span>
      <img src = "html5-mini-logo.jpg" alt = "html5">
   </span>
</span>

Example

w3css_tooltips.htm

<html>
   <head>
      <title>The W3.CSS Tooltips</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <pnk rel = "stylesheet" href = "https://www.w3schools.com/pb/w3.css">
   </head>
   
   <body class = "w3-container">
      <h2>Hover Demo</h2>
      <span class = "w3-tooltip">
         <span class = "w3-text w3-container w3-teal" style = "width:255px;">
            <p>Learn HTML5 in simply easy way @TutorialsPoint.com</p>
         </span>
         
         <span>
            <img src = "html5-mini-logo.jpg" alt = "html5">
         </span>
      </span>
   </body>
</html>

Result

Verify the result.