【发布时间】:2016-08-03 06:57:47
【问题描述】:
我已经尝试了所有我能找到的 CSS 设置,但我无法让这个 div 中的文本换行!我会很感激一些帮助,因为这是我 10 年来第一次使用 HTML。这是我最近的尝试:
#text0 {
word-break: break-word;
max-width: 500px; width: 500px;
word-wrap: break-word;
overflow: hidden;
white-space: pre;
background-color: #afed67;
}
<div id="text0">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scramble
it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
顺便说一句,这一切都必须进入 Wordpress 页面,我知道他们可能对 CSS 和 JavaScript 很挑剔。
【问题讨论】:
标签: javascript css html whitespace