属性定义及使用说明
text-wrap属性指定文本换行规则。
| 默认值: | normal |
|---|---|
| 继承: | yes |
| 版本: | CSS3 |
| JavaScript 语法: | object.style.textWrap=”none” |
语法
text-wrap: normal|none|unrestricted|suppress;| 值 | 描述 |
|---|---|
| normal | 只在允许的换行点进行换行。 |
| none | 不换行。元素无法容纳的文本会溢出。 |
| unrestricted | 在任意两个字符间换行。 |
| suppress | 压缩元素中的换行。浏览器只在行中没有其他有效换行点时进行换行。 |
浏览器支持
任何主流浏览器都不支持text-wrap属性。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web176教程网(web176.com)</title>
<style>
p.test1
{
width:11em;
border:1px solid #000000;
text-wrap:none;
}
p.test2
{
width:11em;
border:1px solid #000000;
text-wrap:normal;
}
</style>
</head>
<body>
<p class="test1">这段包含一些文本。这一行的文字不会换行到下一行。</p>
<p class="test2"> 这段包含一些文本。这一行的文字正常换行。.</p>
</body>
</html>作者:terry,如若转载,请注明出处:https://www.web176.com/css3textpro/5145.html
支付宝
微信