Html Firefox 页面源中的红色字体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9850931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Red font in Firefox Page Source
提问by John Smith
I have been messing around with my meta descriptions, trying to make them more unique by showing relevant data from the database.
我一直在处理我的元描述,试图通过显示数据库中的相关数据来使它们更加独特。
But when I check the meta description by right-clicking in Firefox and showing the page source, the meta description tags is in red color, making me think I have made some kind of mistake.
但是当我通过在 Firefox 中右键单击并显示页面源来检查元描述时,元描述标签是红色的,让我觉得我犯了某种错误。
What does the red text usually mean?
红色文字通常是什么意思?
采纳答案by kernelpanic
2 attributes are usually the most important one in meta tags: name and content
2个属性通常是元标签中最重要的一个:名称和内容
so description tag may look like
所以描述标签可能看起来像
<meta name="description" content="My site description">
You probably forgot to close the double quotes, or using quotes-wrapper word in content attribute ?
您可能忘记关闭双引号,或在内容属性中使用引号包装词?
<meta name="description" content="My "cool" site description">
in which case source viewer does not validate the code.
在这种情况下,源代码查看器不会验证代码。
This is also valid for single quotes. If your meta tag uses single quotes and there's an apostrophe inside content attribute..
这也适用于单引号。如果您的元标记使用单引号并且内容属性中有一个撇号..
<meta name='description' content='Bob's website description'>
回答by user334639
If you hover over that red line, Firefox gives you the answer.
如果您将鼠标悬停在该红线上,Firefox 会给您答案。
It may not be easy to intepret it, but it is precise enough.
解释它可能并不容易,但它足够精确。
回答by Jukka K. Korpela
Red color in viewing source on Firefox indicates a syntax error, in the very basic structure of HTML tags. So it has nothing to do with the meaning of your tags or content, or even the names of tags and attributes.
在 Firefox 上查看源代码中的红色表示 HTML 标记的基本结构中的语法错误。所以它与你的标签或内容的含义,甚至标签和属性的名称无关。
To get a detailed error report, use a validator like http://validator.w3.org.
要获得详细的错误报告,请使用像http://validator.w3.org这样的验证器。
回答by ZOXEXIVO
Tag form cannot contain tag form
标签形式不能包含标签形式
<form action="/">
.....
//RED FONT IN FIREFOX
<form action="/">
</form>
....
</form>