html - 如何在 HTML 页面上显示 HTML 片段?
问题描述
我希望我的项目<div>
在网站上显示引用。我正在使用<code>
标签。但是,它没有出现。这是我正在使用的一段代码:
<div class="section">
<h3>Additional Style</h3>
<h2>Box Model of <code><div></code>
<!--
I want this code to output the following: Box Model of <div>
However, it outputs: Box Model of
-->
</h2>
<ul>
<li>padding: 40px,</li>
</ul>
</div>
预先感谢!
解决方案
使用>
and<
代替代码。
推荐阅读
- javascript - 使用 push() 创建名称为变量的 JSON 对象?
- typescript - Webpack 4,Vue 同时使用 Typescript 类和 JS 代码。
- docker - Dockerignore:允许从任何子文件夹中仅添加特定的扩展名,如 *.json
- angular - Angular删除父元素而不影响子元素
- go - 如何使用“encoding/gob”在 Go 中可靠地编码和发送 OpenCV Mat 对象?
- php - php oop没有从数据库中获取数据
- c# - 如何获取字符串中两个相同字符的索引?
- r - 在 R 中读取 csv 文件并从最后一列中列出
- javascript - Node.js 等效于 Yarn 命令
- javascript - 红圈不会消失,onclick javascript