W3.CSS使用w3-tooltip类支持另一种工具提示。看下面的例子。在这里,我们将工具提示文本放在div和图像中,并将w3 – Tooltips应用于父div。
<div class = "w3-tooltip"> <div class = "w3-text w3-container w3-teal" style = "width:255px;"> <p>Learn HTML5 in simply easy way @TutorialsPoint.com</p> </div> <div> <img src = "html5-mini-logo.jpg" alt = "html5"> </div> </div>
例
w3css_tooltips.htm
<html> <head> <title>The W3.CSS Tooltips</title> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <link rel = "stylesheet" href = "https://www.w3schools.com/lib/w3.css"> </head> <body class = "w3-container"> <h2>Hover Demo</h2> <div class = "w3-tooltip"> <div class = "w3-text w3-container w3-teal" style = "width:255px;"> <p>Learn HTML5 in simply easy way.</p> </div> <div> <img src = "/wp-content/uploads/2020/11/w3c-480x300.jpg" alt = "html5"> </div> </div> </body> </html>
作者:terry,如若转载,请注明出处:https://www.web176.com/w3css/925.html