Red font in Firefox Page Source

2020-03-01 04:57发布

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.

What does the red text usually mean?

标签: html
4条回答
家丑人穷心不美
2楼-- · 2020-03-01 05:48

2 attributes are usually the most important one in meta tags: name and content

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'>
查看更多
祖国的老花朵
3楼-- · 2020-03-01 05:50

If you hover over that red line, Firefox gives you the answer.

It may not be easy to intepret it, but it is precise enough.

查看更多
Animai°情兽
4楼-- · 2020-03-01 05:51

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.

To get a detailed error report, use a validator like http://validator.w3.org.

查看更多
做个烂人
5楼-- · 2020-03-01 05:58

Tag form cannot contain tag form

<form action="/">

.....

//RED FONT IN FIREFOX
<form action="/">
</form>


....
</form>
查看更多
登录 后发表回答