html - 自动换行问题

标签 html css word-wrap

我在 div 中有一些文本,我希望它换行以适合文档宽度(没有任何卷轴!)。我不想断字,比如 div {word-wrap: break-word;}

例如(这是我想要得到的):

hello world! today is a 
good day.

但不是:

hello world! today is a  good day.

或:

hello world! today is a go
od day.

最佳答案

不知道你想要什么,是这个吗?

<div style="width:200px">hello world! today is a good day.</div>

关于html - 自动换行问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2964406/

相关文章:

php - 在php中,是否可以创建两个同名的输入框?

html - 如何居中更大的背景

html - 为什么我的文字闪烁?

html - 使用 CSS,你能根据文本的中间点断行吗?

PHP mysqli_fetch_array 如何转到下一行?

javascript - 克隆的div在appendChild后消失

html - 使用 font-face 显示自定义西里尔字体时出现问题

javascript - 使用 div 创建 JQuery 下拉菜单

java - 如何在 JTextArea 中换行

css - 防止包裹在 CSS 中的嵌套 float 项中