Material Design lite 工具提示定位
Material Design lite tooltip positioning
我正在使用 material design lite
库,但我遇到了问题。当我减少 window 时,有时工具提示不是 positioning
并且还使用 2 lines
而不是 one
。
Html
<html>
<head>
<!-- Material Design Lite -->
<script src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<!-- Rich Tooltip -->
<button id="tt3" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">add</i>
</button>
<div class="mdl-tooltip mdl-tooltip--top " data-mdl-for="tt3">
Upload <strong>file.zip</strong>
</div>
</body>
</html>
Css
#tt3
{
position:fixed;
right:24px;
bottom:24px;
}
试试这个
.mdl-tooltip.mdl-tooltip--top{ width:70px;}
#tt3
{
position:fixed;
right:24px;
bottom:24px;
}
.mdl-tooltip.mdl-tooltip--top{
width:70px;
}
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<!-- Material Design Lite -->
<script src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Rich Tooltip -->
<button id="tt3" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">add</i>
</button>
<div class="mdl-tooltip mdl-tooltip--top " data-mdl-for="tt3">
Upload <strong>file.zip</strong>
</div>
我正在使用 material design lite
库,但我遇到了问题。当我减少 window 时,有时工具提示不是 positioning
并且还使用 2 lines
而不是 one
。
Html
<html>
<head>
<!-- Material Design Lite -->
<script src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<!-- Rich Tooltip -->
<button id="tt3" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">add</i>
</button>
<div class="mdl-tooltip mdl-tooltip--top " data-mdl-for="tt3">
Upload <strong>file.zip</strong>
</div>
</body>
</html>
Css
#tt3
{
position:fixed;
right:24px;
bottom:24px;
}
试试这个
.mdl-tooltip.mdl-tooltip--top{ width:70px;}
#tt3
{
position:fixed;
right:24px;
bottom:24px;
}
.mdl-tooltip.mdl-tooltip--top{
width:70px;
}
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<!-- Material Design Lite -->
<script src="https://code.getmdl.io/1.2.0/material.min.js"></script>
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Rich Tooltip -->
<button id="tt3" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">add</i>
</button>
<div class="mdl-tooltip mdl-tooltip--top " data-mdl-for="tt3">
Upload <strong>file.zip</strong>
</div>