是< q>标签与在html中手动添加双引号相同? [英] Is the <q> tag same as adding double quotes manually in html?

查看:235
本文介绍了是< q>标签与在html中手动添加双引号相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始从w3schools.com学习html。在这个例子中,我们可以使用<$添加双引号到任何文本c $ c>< q> >标签。我想知道的是,我们也可以手动添加双引号,例如

< q>文本引用< / q>

$ b

如果我们手动添加双引号,它们的渲染效果也会一样



text quoted



  • 这两种方法有什么不同双引号?



解决方案

使用< q> 元素,阅读该页面的软件(浏览器,搜索引擎蜘蛛等)知道它是一个引号,可能对它有不同的处理规则:浏览器可能会以不同的方式呈现它,例如用斜体字或不同文化的引用符号(日本不使用引号,它们使用直角符号),搜索引擎可以在别处查找引用,提供引用。如果你不标记你的文本,那么这些场景都是不可能的。



这个属于语义网络的总称 - 它是关于标记通过描述其内容的含义,而不仅仅是它看起来的样子。

另外,不要使用W3Schools:它们在教授只需要达到和结束所需的绝对基本知识方面的声誉很差 - 目标往往与讨厌的捷径,它灌输坏习惯。相反,当我了解网络时,我会推荐诸如Mozilla Developer Network(MDN)之类的资源。


I have recently started learning html from w3schools.com. In this example we can add double quotes to any text by using <q> tag around it. What I wonder is that we can simply add double quotes manually too, e.g.

<q>text quoted</q>

will render just same if we instead add double quotes manually

"text quoted"

  • Is there any differnce between these two methods to add double quotes?

解决方案

The difference is that when you use the <q> element the software reading the page (a browser, a search engine spider, etc) knows that it's a quotation and might have different processing rules for it: browsers might render it differently, in italics for example, or a different culture's quote symbols (Japan doesn't use quotes, they use right-angle symbols) and search engines could look-up the quote elsewhere and provide a citation. If you don't mark-up your text then none of these scenarios are possible.

This falls under the umbrella term "the semantic web" - it's about markup throughly describing its content's meaning, not just the way it looks.

Also, don't use W3Schools: they have a poor reputation for teaching only the absolute basics required to achieve and end-goal, often with nasty shortcuts and it instills bad habits. Instead I recommend resources like Mozilla Developer Network (MDN) when learning about the web.

这篇关于是&lt; q&gt;标签与在html中手动添加双引号相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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