W3C的XHTML验证问题与样式表链接 [英] XHTML validation problem at W3C with stylesheet link

查看:53
本文介绍了W3C的XHTML验证问题与样式表链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法在任何地方尝试制作我的网页

过渡性XHTML。


<!DOCTYPE html PUBLIC" ; - // W3C // DTD XHTML 1.0 Transitional // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


W3C验证器返回了很多错误,但第一个错误

让我难过。这是我的样式表链接标记。

< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">


W3C验证员对此进行了说明:


第9行,第10列:有没有属性REL (解释......)。

< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">

^

第9行,第28列:没有属性HREF (解释......)。

< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">

^

第9行,第46列:没有属性type (解释......)。

< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">

^

第9行,第56列:元素LINK undefined(解释......)。

< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">

^

W3C对这些错误的解释还有很多不足之处。


我尝试了很多变化并获得了相同的结果。


有谁可以解释这个并告诉我如何修复它?


另外,第二行是否应该有一个名称空间标签?

< html xmlns =" http://www.w3.org/1999/xhtml" XML:朗= QUOT;恩" lang =" en">


感谢您的帮助。

I don''t seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There are many errors returned at the W3C validator but the first one
has me stumped. It''s my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

The W3C validator says this about it:

Line 9, column 10: there is no attribute "REL" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 28: there is no attribute "HREF" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 46: there is no attribute "type" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
The W3C explanations of these errors leave a lot to be desired.

I tried many variations and got pretty much the same results.

Can anyone explain this and tell me how to fix it?

Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Thanks for your help.

推荐答案

" Bruce W ... 1" <峰; br *** @ noDirectEmail.com>写道:
"Bruce W...1" <br***@noDirectEmail.com> wrote:
我似乎无法在任何地方尝试制作我的网页
过渡XHTML。

<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


看起来是正确的。

W3C验证器返回了很多错误,但第一个错误让我难过。这是我的样式表链接标记。
< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">

W3C验证器说明了这一点:第9行,第10列:没有属性REL (解释......)。
< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">
^ />第9行,第28列:没有属性HREF (解释......)。
< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">
^
第9行,第46列:没有属性type (解释......)。
< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">
^


以上三个错误都是以下错误的症状。修复这个

他们将会消失。

第9行,第56栏:元素LINK undefined(解释......)。
< LINK REL =" stylesheet" HREF =" styles.css的"类型= QUOT;文本/ CSS">


好​​吧,有些事情是错的,但基于你告诉我们的事情,这是不可能告诉我们什么的。给我们一个URL,这样我们就可以检查出来了。

另外,第二行是否应该有一个名称空间标签?
< html xmlns =" http:// www.w3.org/1999/xhtml" XML:朗= QUOT;恩" lang =" en">
I don''t seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
That looks correct.
There are many errors returned at the W3C validator but the first one
has me stumped. It''s my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

The W3C validator says this about it:

Line 9, column 10: there is no attribute "REL" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 28: there is no attribute "HREF" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 46: there is no attribute "type" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
The three errors above are all symptoms of the error below. Fix this
and they will vanish.
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
Well, something''s wrong but based on what you''ve told us it''s
impossible to tell what. Give us the URL so we can check it all out.
Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">




是的,这是正确的。


Steve
< br $> b $ b -

我的理论给你起见,我的异端邪说你们,

我从不回信,你不喜欢我的领带" - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



Yes, that''s correct.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>


On Fri,2003年11月28日18:46:29 -0500,Bruce W ... 1

< br *** @ noDirectEmail.com>写道:
On Fri, 28 Nov 2003 18:46:29 -0500, "Bruce W...1"
<br***@noDirectEmail.com> wrote:
我似乎无法在任何地方尝试制作我的网页
过渡XHTML。

<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

在W3C验证器上返回了很多错误,但第一个错误让我难过。这是我的样式表链接标记。
< LINK REL =" stylesheet" HREF =" styles.css的" type =" text / css">
I don''t seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There are many errors returned at the W3C validator but the first one
has me stumped. It''s my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">



[snip]


请注意,你必须在XHTML中使用小写(是的,即使在

过渡期内)。


< link rel =" stylesheet" HREF =" styles.css的" type =" text / css">


应该验证(无论如何都适用于我)


[snip]

Note that you have to use lower case in XHTML (yes, even in
transitional).

<link rel="stylesheet" href="styles.css" type="text/css">

Should validate (it does for me anyway)


" Bruce W ... 1" <峰; br *** @ noDirectEmail.com>写道:
"Bruce W...1" <br***@noDirectEmail.com> wrote:
我似乎无法在任何地方尝试制作我的网页
过渡XHTML。


你为什么要这样做?你只需使用

XHTML即可获得任何地方,这些日子主要意味着在这里抛出一些技术支持

和一些斜线并让人感到困惑。此外,你没有使用

斜杠。哦,你没有使用小写。

< LINK REL =" stylesheet" HREF =" styles.css的"类型= QUOT;文本/ CSS">


在XHTML中,所有元素都必须包含结束标记,并且所有元素和

属性名称必须为小写。如果你不知道这个,_why_

你在使用XHTML吗?我们可以告诉你使用

< link rel =" stylesheet" HREF =" styles.css的"类型= QUOT;文本/ CSS" />

但这只是意味着使用XHTML的使用XHTML

的无用游戏中的一些步骤。

W3C对这些错误的解释还有很多不足之处。


对不起,验证员只是做你要求它做的事情。这不是你的错,你不知道你要的是什么。

另外,第二行是否应该有一个名称空间标签?
< html xmlns =" http://www.w3.org/1999/xhtml" xml:lang =" en"
lang =" en">
I don''t seem to be getting anywhere with trying to make my web page
transitional XHTML.
So why are you trying that? You _won''t_ get anywhere by just "using
XHTML", which these days mostly means throwing some technobabble here
and some slashes there and getting confused. Besides, you''re not using
the slashes. Oh, and you''re not using lowercase.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
In XHTML, all elements must have end tags, and all element and
attribute names must be in lower case. If you didn''t know this, _why_
are you using XHTML? We could tell you to use
<link rel="stylesheet" href="styles.css" type="text/css" />
but that would just mean some steps in a useless game of "using XHTML"
for the sake of using XHTML.
The W3C explanations of these errors leave a lot to be desired.
Sorry, but the validator is simply doing what you asked it to do. It''s
not its fault that you didn''t know what you were asking for.
Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">




在XHTML中,xmlns属性(可能是你的意思)

" namespace tag")是散文描述所必需的。验证者

不会关心,因为声明属性的方式 - 但是另外提醒一下,验证并不意味着一致性

到规格。


-

Yucca, http://www.cs.tut.fi/~jkorpela/

关于网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html



In XHTML, the xmlns attribute (which is probably what you mean by
"namespace tag") is required by the prose description. A validator
won''t care, though, due to the way the attribute is declared - yet
another reminder of the fact that validation does not imply conformance
to a specification.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


这篇关于W3C的XHTML验证问题与样式表链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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