阅读751 返回首页    go 阿里云 go 技术社区[云栖]


CSS字数超出自动添加省略号

CSS字数超出自动添加省略号,示例代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  <title>CSS字数超出自动添加省略号</title>
  <style type="text/css">
    div{
      width: 200px;
      height: 200px;
      background-color: #f3f3f3;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
  </style>

</head>
<body>
  <div>121121212121212121212121212121212121212121212222222222222222222222222111111111111111</div>
</body>
</html>


最后更新:2017-04-03 05:40:07

  上一篇:go 再论:男人有多大责任和感恩代表着有多大的驾驭能力和事业能力
  下一篇:go 机房收费系统(VB.NET)个人版总结