如标题所示...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>CSS 文本溢出时显示省略标记</title>  
<style type="text/css">
.overflowTest{
    width:200px;/*基本容器显示宽度*/
    overflow:hidden;/*overflow 属性规定当内容溢出元素框时发生的事情。*/
    text-overflow:ellipsis;/*clip:修剪文本|ellipsis:显示省略符号来代表被修剪的文本|string:使用给定的字符串来代表被修剪的文本(自定义)*/
    white-space:nowrap;/*文本不会换行*/
}
</style>
</head>
<body>
<div>正常显示:qwertyuiopasdfghjklzxcvb</div>
<div class="overflowTest">处理后:qwertyuiopasdfghjklzxcvb</div>
</body>
</html> 

 

相关文章:

  • 2021-07-30
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-11-22
  • 2021-10-08
  • 2021-12-04
  • 2021-11-28
相关资源
相似解决方案