html - 使用 CSS 自动插入 <br/> 标签

标签 html css

我是 CSS 的新手,我想尽量减少我在 HTML 文档中所做的标记量。

有没有办法将换行符定义为 <br />因此对于给定的 <div>我定义的我可以执行以下操作:

.description {
        br: on;
    color: #D3E22A;
    width: wrap; 
}

最佳答案

white-space: pre;

white-space: pre-wrap;

参见 the specs .

关于html - 使用 CSS 自动插入 <br/> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1930671/

相关文章:

html - CSS:悬停时着色圆形div?只在 div 后面着色?

css - Angular Material Theme 不会改变 mat-dialog 的强调色

css - 绝对 : position on center (image)

css - 将带有样式的 DIV 包裹在嵌入的 YouTube 视频中

jquery - 仅在桌面上将导航固定到顶部

html - 将页脚设置为内容或页面结尾

java - 无法获取img标签

javascript - 为什么使用 `<button>` 作为 `&lt;input type="文件“>` not work, but ` <a>` 的委托(delegate)在 Safari 中有效?

javascript - 如何将 css 应用于 asp.net LinkBut​​ton?

html - 当在移动设备上单击时,spritesheet 图像会在其周围显示灰色框