Skip to content

Latest commit

 

History

History
8 lines (6 loc) · 514 Bytes

200101.md

File metadata and controls

8 lines (6 loc) · 514 Bytes

html 标签 pre 的使用

什么是 pre

  1. pre 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。
  2. pre 标签的一个常见应用就是用来表示计算机的源代码。

值得注意的

  1. 在 pre 标签里使用 html 标签,或者说要保留 html 源码,,要将 pre 标签中的特殊符号被转换为符号实体,比如 "& l t;" 代表 "<","& g t;" 代表 ">","& a m p;" 代表 "&"。