css text-wrap属性怎么用


本文摘自PHP中文网,作者藏色散人,侵删。

css text-wrap属性用于规定文本的换行(折行)规则,其语法是text-wrap: normal|none|unrestricted|suppress;目前主流浏览器都不支持text-wrap属性。

css text-wrap属性怎么用

作用:text-wrap 属性规定文本的换行(折行)规则。

语法:

1

text-wrap: normal|none|unrestricted|suppress

说明:

normal 只在允许的换行点进行换行。

none 不换行。元素无法容纳的文本会溢出。

unrestricted 在任意两个字符间换行。

suppress 压缩元素中的换行。浏览器只在行中没有其他有效换行点时进行换行。

注释:目前主流浏览器都不支持 text-wrap 属性。

css text-wrap属性使用示例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

<!DOCTYPE html>

<html>

<head>

<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"> This paragraph contains some text. This line should not breake or wrap to the next line.</p>

<p class="test2"> This paragraph contains some text: The line breaks as normal.</p>

<p><b>注释:</b>目前主流浏览器都不支持 text-wrap 属性。</p>

</body>

</html>

效果输出:

a1e60440eaa2bddeb8b888740ff44bf.png

以上就是css text-wrap属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css怎么设置字母大写

css中什么是外部样式表?

css设置字体粗细的属性是什么

css column-rule-color属性怎么用

css权重是什么?css权重的介绍

css如何滚动图片

css中怎么设置虚线上边框

你会使用css锚点么

css如何设置渐变色

css实现tab页切换效果

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    暂无评论...