- Material Design Lite 教程
- MDL - 主页
- MDL - 概述
- MDL - 环境设置
- MDL - 布局
- MDL - 网格
- MDL - 选项卡
- MDL - 页脚
- MDL - 徽章
- MDL - 按钮
- MDL - 卡片
- MDL - 进度条
- MDL - 纺纱机
- MDL - 菜单
- MDL - 滑块
- MDL - 复选框
- MDL - 单选按钮
- MDL-图标
- MDL - 开关
- MDL-数据表
- MDL - 文本字段
- MDL - 工具提示
- Material Design Lite 资源
- MDL - 快速指南
- MDL - 有用的资源
- MDL - 讨论
Material Design Lite - 工具提示
MDL 提供了一系列 CSS 类来应用各种预定义的视觉和Behave增强功能并显示不同类型的工具提示。下表列出了可用的类别及其效果。
| 先生。 | 类名和描述 |
|---|---|
| 1 | MDL 工具提示 将容器标识为 MDL 工具提示,并且在工具提示容器元素上是必需的。 |
| 2 | mdl-工具提示--大 设置大字体效果,可选;继续工具提示容器元素。 |
例子
以下示例将帮助您了解如何使用mdl-tooltip类来显示不同类型的工具提示。
mdl_tooltips.htm
<html>
<head>
<script
src = "https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js">
</script>
<link rel = "stylesheet"
href = "https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
<link rel = "stylesheet"
href = "https://fonts.googleapis.com/icon?family=Material+Icons">
<script langauage = "javascript">
function showMessage(value) {
document.getElementById("message").innerHTML = value;
}
</script>
</head>
<body>
<table>
<tr><td>Simple Tooltip</td><td>Large Tooltip</td></tr>
<tr>
<td>
<div id = "tooltip1" class = "icon material-icons">add</div>
<div class = "mdl-tooltip" for = "tooltip1">Follow</div>
</td>
<td>
<div id = "tooltip2" class = "icon material-icons">print</div>
<div class = "mdl-tooltip mdl-tooltip--large" for = "tooltip2">Print</div>
</td>
</tr>
<tr>
<td>Rich Tooltip</td><td>Multiline Tooltip</td></tr>
<tr>
<td>
<div id = "tooltip3" class = "icon material-icons">cloud_upload </div>
<div class = "mdl-tooltip" for = "tooltip3">Upload <i>zip files</i></div>
</td>
<td>
<div id = "tooltip4" class = "icon material-icons">share</div>
<div class = "mdl-tooltip" for = "tooltip4">
Share your content<br>using social media</div>
</td>
</tr>
</table>
</body>
</html>
结果
验证结果。