jsp页面显示指定文字,多余的用...代替,鼠标指着会显示全部内容

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ellipsis</title>
</head>
<body>
<style>
.demo {display: inline-block;*display: inline;*zoom: 1;width: 140px;height: 20px;line-height: 20px;font-size: 12px;overflow: hidden;-ms-text-overflow: ellipsis;text-overflow: ellipsis;white-space: nowrap;}
.demo:hover {height: auto;white-space: normal;}
</style>
<a href="#" target="_blank" class="demo">这是一段测试用的文本,没有实际意义,只是想达到显示效果。</a>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/shiboyuan0410/article/details/84133731