text-overflow text overflow

It is recommended to use text-overflow:ellipsis; after the text exceeds, it will be displayed in the form of ellipsis
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (runoob.com)</title>
<style>
div.test
{
	white-space:nowrap;
	width:12em;
	overflow:hidden;
	border:1px solid #000000;
}
</style>
</head>
<body>
<p>The text in the following div container cannot be fully displayed, as you can see it is clipped. </p>
<p>div 使用 "text-overflow:ellipsis":</p>

<div class="test" style="text-overflow:ellipsis;">This is some long text that will not fit in the box</div>
<p>div 使用 "text-overflow:clip":</p>
<div class="test" style="text-overflow:clip;">This is some long text that will not fit in the box</div>
<p>div uses custom string "text-overflow: >>" (only works in Firefox browser):</p>
<div class="test" style="text-overflow:'>>';">This is some long text that will not fit in the box</div>
</body>
</html>

The code effect is as follows


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327100380&siteId=291194637