html - 按 html blockquote 标签中的原样显示文本

标签 html css

我想在 blockquote 中显示文本标签

<blockquote>
  This is my formatted text 
  This is the second line
</blockquote>

而不是 <pre>标签。

<pre>
  This is my formatted text
  This is the second line
</pre>

因为我无法更改 <blockquote><pre>标签,但我希望以与使用 <pre> 相同的方式显示文本标签。

有什么方法可以在CSS中做到这一点吗?

最佳答案

将其添加到您的 CSS 中:

blockquote {
    display: block;
    font-family: monospace;
    white-space: pre;
    margin: 1em 0;
}

关于html - 按 html blockquote 标签中的原样显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48447340/

相关文章:

Html 文本区域 : problems with accented letters

html - 如何为网络和移动设备使用两种不同的设计

html - Bradley Hand ITC Bold 字体未在 mozilla 和 chrome 中显示

javascript - 创建一个动画序列循环 jquery

javascript - 如何使用 javascript 使用 Twitter API

javascript - 如何在 Angular2 中申请日期?

javascript - 使用Dropzone通过asp.net上传两次

jquery - 反转(或切换)动画和淡入淡出

html - Li向左浮动,长度动态: no border-bottom on the last row

html - 解析错误和无法识别的媒体仅 css 验证