< pre>之间的区别是什么?和< code> HTML标签? [英] What is difference between <pre> and <code> HTML Tag?

查看:202
本文介绍了< pre>之间的区别是什么?和< code> HTML标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< pre> HTML标记与< code> html标记有什么不同?



我检查过W3Schools页面,看起来它们是一样的。

如果它们之间有任何主要区别?

解决方案

不要去w3schools。查看 pre 代码 b
$ b

PRE:


PRE元素告诉可视用户代理所附的文本是
预格式化。处理预格式化文本时,可视用户代理:


  • 可能会保留空格不变。固定间距字体的文本。
  • 可禁用自动换行功能。

  • 不得禁止双向处理。

CODE:


指定一个片段的计算机代码。



How does a <pre> HTML tag differs from <code> html tag.

I have checked on W3Schools page, it seems they are just the same.

If there any major difference between them ?

解决方案

Don't go to w3schools. Check the w3c documentation for pre and code instead.

PRE:

The PRE element tells visual user agents that the enclosed text is "preformatted". When handling preformatted text, visual user agents:

  • May leave white space intact.
  • May render text with a fixed-pitch font.
  • May disable automatic word wrap.
  • Must not disable bidirectional processing.

CODE:

Designates a fragment of computer code.

这篇关于&lt; pre&gt;之间的区别是什么?和&lt; code&gt; HTML标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆