word-wrap(overflow-wrap) 此属性用于表明当一个不能被分开的字符串太长时,是否允许这样的单词中断换行。 可以继承 属性值:normal(默认值):在单词结尾处才换行break-word:如果要换行的话,强行将单词折断换行。word-break CSS 文本换行的设置方法 ) CSS3word-wrap属性允许长的内容可以
Safari 18.2 18.3 18.4 18.5 TP Firefox 136 137 138 139 140 141 142 Opera 114 115 116 117 IE 8 9 10 11 Chrome for Android 137 Safari on iOS 18.2 18.3 18.4 18.5 Samsung Internet 25 26 27 28 Opera Mini all Opera Mobile 11.5 12
The overflow-wrap CSS property applies to text, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
Overflow-wrap属性是CSS中用于控制文本在容器内换行的属性。它主要用于处理当文本内容超出容器宽度时的换行方式。 Overflow-wrap属性有两个可能的值: normal:默认值,表示文本会在单词之间换行,以保持整个单词在容器内显示。 break-word:表示文本会在任意字符之间换行,以适应容器宽度。
The overflow-wrap CSS property applies to text, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
white-space 的一个作用是控制长句子是否自动在空白处折行,而 overflow-wrap 和 word-break 是作用在单词上,用于控制长单词是否折行。 Properties that define how words break within themselves: overflow-wrap, word-break。 2. word-break 含义: The word-break CSS property sets whether line breaks appear...
The overflow-wrap property in CSS allows you to specify that the browser can break a line of text inside the targeted element onto multiple lines in an
.container { display: flex; } .overflow-wrap-anywhere { background-color: #2fe262; border: 2px solid #000000; width: 100px; height: 150px; overflow-wrap: anywhere; margin-right: 50px; } .overflow-wrap-break-word { background-color: #2fe262; border: 2px solid #000000; width:...
overflow-wrap:break-word; } Working Example within an HTML Document xxxxxxxxxx <!DOCTYPE html> Example p{ width:12em; overflow-wrap:break-word; background:beige; } Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu is located in New Zealand. View Output C...
CSS中的overflow-wrap属性用于指定浏览器可以在任何目标元素内中断文本行,以防止在原始字符串太长而无法容纳时溢出。此属性先前称为word-wrap,某些浏览器仍支持该属性,但在CSS3草案中将其重命名为overflow-wrap。 用法: .box{overflow-wrap:break-word;