Heim  >  Artikel  >  Web-Frontend  >  css实现文本超出li宽度的部分隐藏_html/css_WEB-ITnose

css实现文本超出li宽度的部分隐藏_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:31:161183Durchsuche

css实现文本超出li宽度的部分隐藏:
在某些实际应用中,希望把文本超出的部分隐藏而非换行,下面就是一段这样的代码实例,大家可以参考一下。
代码如下:

<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>蚂蚁部落</title> <style type="text/css"> #content{  width:130px;  height:80px;  background-color:green;  white-space:nowrap;  text-overflow:ellipsis;   overflow:hidden;}</style> </head> <body> <div id="content">蚂蚁部落欢迎您,只有奋斗才会有美好的明天</div></body> </html>

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=9681

更多内容可以参阅:http://www.softwhy.com/divcss/

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn