Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 第409天 pre与xmp标签有什么区别? #2440

Open
haizhilin2013 opened this issue May 28, 2020 · 2 comments
Open

[html] 第409天 pre与xmp标签有什么区别? #2440

haizhilin2013 opened this issue May 28, 2020 · 2 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第409天 pre与xmp标签有什么区别?

3+1官网

我也要出题

@haizhilin2013 haizhilin2013 added the html html label May 28, 2020
@c-simon77
Copy link

c-simon77 commented May 29, 2020

xmp的标签,会复把抱在内部的html片段当作字符串输出(此标签已废弃)
<pre></pre> 标签,可以在保留原来文本格式的基础制上让文本在页面上显示出来
<pre> 标签中的特殊符号被转换为符号实体,比如 "&lt;" 代表 "<","&gt;" 代表 ">"。

xmp
<xmp> <div>xmp</div> </xmp>
//输出
<div>xmp</div>

pre
<pre> <strong>pre</strong> </pre>
//输出
加粗的pre

@zhaofeipeter
Copy link

1、pre标签:按原样输出,保留所有的空格和换行符。
2、xmp标签:会把内部的html片段当作字符串输出

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

3 participants