是< q>标签与在html中手动添加双引号相同? [英] Is the <q> tag same as adding double quotes manually in html?
问题描述
我最近开始从w3schools.com学习html。在这个例子中,我们可以使用<$添加双引号到任何文本c $ c>< q> >标签。我想知道的是,我们也可以手动添加双引号,例如
如果我们手动添加双引号,它们的渲染效果也会一样 使用 这个属于语义网络的总称 - 它是关于标记通过描述其内容的含义,而不仅仅是它看起来的样子。< q>文本引用< / q> $ c
$ b
text quoted
< q>
元素,阅读该页面的软件(浏览器,搜索引擎蜘蛛等)知道它是一个引号,可能对它有不同的处理规则:浏览器可能会以不同的方式呈现它,例如用斜体字或不同文化的引用符号(日本不使用引号,它们使用直角符号),搜索引擎可以在别处查找引用,提供引用。如果你不标记你的文本,那么这些场景都是不可能的。
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.
这篇关于是< q>标签与在html中手动添加双引号相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!