来自业余的Doctype问题 [英] Doctype question from amateur

查看:62
本文介绍了来自业余的Doctype问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试清理我的网站,现在它的状态非常好,

但是我对阅读Doctypes感到困惑。我的网站是
http://www.simi-therapy.com

和我的CSS是
http://www.simi-therapy.com/simitherapy-screen.css


我的页面全部以

$ b $开头b<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Strict // EN"

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

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

< head>

< meta http-equiv =" Content-Type"含量=" text / html的;字符集= UTF-8英寸/>

< meta http-equiv =" Content-Language"含量=" EN-US" />


我认为这来自我正在使用的模板,但我不确定。

我应该使用XHTML严格,还是HTML 4.01严格?如果我应该改变它,我会在每一行中放置什么?


我应该提到我的页面有两件事不值得验证

XHTML严格。一个是Google搜索引擎标记,另一个是我使用地址块进行格式化的
因为我还没弄明白

如何使用CSS来获取相同的结果。


感谢您的帮助。这个小组教会了我很多 - 我很惊讶

我在这里学到的很多。


Deborah

I''m trying to clean up my website, and it''s in pretty good shape now,
but I''ve gotten confused reading about Doctypes. My site is
http://www.simi-therapy.com
and my CSS is
http://www.simi-therapy.com/simitherapy-screen.css .

My pages all start with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />

I think this came from the template I am using, but I''m not sure.
Should I be using XHTML strict, or HTML 4.01 strict? And if I should
change it, what exactly do I put in each line?

I should mention that my pages have 2 things that don''t validate in
XHTML strict. One is a Google search engine tag, and another is me
using an address block for formatting, because I haven''t yet figured out
how to use CSS to get the same result.

Thanks for your help. This group teaches me a lot -- I am amazed at how
much I have learned here.

Deborah

推荐答案

在文章< lX **************** @ newssvr19.news.prodigy.net>,

Deborah< de ********* @ sbcglobal.netwrote:
In article <lX****************@newssvr19.news.prodigy.net>,
Deborah <de*********@sbcglobal.netwrote:

我正在试图清理我的网站,它是'现在状态很好,

但我对阅读Doctypes感到困惑。我的网站是
http://www.simi-therapy.com

和我的CSS是
http://www.simi-therapy.com/simitherapy-screen.css


我的页面全部以

$ b $开头b<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Strict // EN"

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

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

< head>

< meta http-equiv =" Content-Type"含量=" text / html的;字符集= UTF-8英寸/>

< meta http-equiv =" Content-Language"含量=" EN-US" />


我认为这来自我正在使用的模板,但我不确定。

我应该使用XHTML严格,还是HTML 4.01严格?如果我应该改变它,我会在每一行中放置什么?


我应该提到我的页面有两件事不值得验证

XHTML严格。一个是Google搜索引擎标记,另一个是我使用地址块进行格式化的
因为我还没弄明白

如何使用CSS来获取相同的结果。


感谢您的帮助。这个小组教我很多 - 我很惊讶

我在这里学到的很多。


Deborah
I''m trying to clean up my website, and it''s in pretty good shape now,
but I''ve gotten confused reading about Doctypes. My site is
http://www.simi-therapy.com
and my CSS is
http://www.simi-therapy.com/simitherapy-screen.css .

My pages all start with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />

I think this came from the template I am using, but I''m not sure.
Should I be using XHTML strict, or HTML 4.01 strict? And if I should
change it, what exactly do I put in each line?

I should mention that my pages have 2 things that don''t validate in
XHTML strict. One is a Google search engine tag, and another is me
using an address block for formatting, because I haven''t yet figured out
how to use CSS to get the same result.

Thanks for your help. This group teaches me a lot -- I am amazed at how
much I have learned here.

Deborah



你可以考虑简化你的代码并从你的html中删除< div

class =" midHeader"< / div并删除相关的

css,并合并成这样的东西:


..headerTitle {


background-color:rgb(140,170,230);

background-image:url(''beach hill long.jpg'');

background-repeat:no-repeat;

font-size: 200%;

字体重量:正常;

保证金:0;

填充:0;

max - 高度:100px;最小高度:100px;


}


这种东西似乎在不同的点击下工作得更好

停止在良好的浏览器中调整文本大小。 IE6及以下

我的期望并不是特别高兴。但也许他们不是很不幸。


关于xhtml。也许就像现在一样。在将来的使用中

4.01严格阅读如何运行为此写标签。

/Users/tedkroiter/Sites/droovies/test/test3.html:156 :XHTML

规范建议在空XML元素中包含空格之前的空格

3 /> 2。 (你并不总是这样做)。在4.01

没有必要这样做。


这是一个特殊的使用地址,你的,每一点

地址?摆脱它所包含的范围。而且我会说b b b如果你使用地址,请使用< brto分隔线,而不是

更多地址。


-

dorayme

You might consider simplifying your code and removing the <div
class="midHeader"</divfrom your html and removing the
associated css, and amalgamating into something like this instead:

..headerTitle {

background-color: rgb(140,170,230);
background-image: url(''beach hill long.jpg'');
background-repeat: no-repeat;
font-size: 200%;
font-weight: normal;
margin: 0;
padding: 0;
max-height: 100px;min-height: 100px;

}

This sort of thing seems to work nicer under different click
stops for text size adjustments in good browsers. IE6 and below
is not particularly happier I expect. But perhaps they are not
unhappier.

About xhtml. Perhaps leave it as it is for now. In future use
4.01 Strict and read up on how to run write the tags for this.
/Users/tedkroiter/Sites/droovies/test/test3.html:156: The XHTML
specification recommends including a space before the trailing
3/>2 in empty XML elements. (You do not always do this). In 4.01
there is no need for this.

It is a peculiar use of address, yours, for each bit of an
address?? Get rid of the span in which it is enclosed. And I
would say if you use address, use <brto separate the lines, not
more "address".

--
dorayme


Scripsit Deborah:
Scripsit Deborah:

我''我试图清理我的网站,
I''m trying to clean up my website,



嗯,总有人重写工作代码,清理它或者

加快速度,但为什么呢?定位开始创建

新页面更具建设性。


请注意,这是ciwastylesheets,而不是ciwasite-design。

Well, there''s always someone who rewrites working code, to clean it up or to
speed it up, but why? It''s more constructive to orientate to start creating
new pages well.

Please note that this is c.i.w.a.stylesheets, not c.i.w.a.site-design.


我应该使用XHTML严格,还是HTML 4.01严格?
Should I be using XHTML strict, or HTML 4.01 strict?



是的。


哦,你的意思是哪个更好?如果你不得不问,那肯定是HTML 4.01

严格。

Yes.

Oh, you meant which is better? If you had to ask, then surely HTML 4.01
Strict.


如果我应该

更改它,我究竟要在每一行中放入什么?
And if I should
change it, what exactly do I put in each line?



您应该完全按照HTML

规范中的规定编写DOCTYPE声明,主要是为了使浏览器以标准模式工作,提供

您创建按规格使用CSS的页面。

You should write a DOCTYPE declaration exactly as specified in the HTML
specifications, mainly to make browsers work in "standards mode", provided
that you create pages that use CSS by the specifications.


我应该提到我的页面有两件事不值得验证

XHTML严格。一个是Google搜索引擎标记,另一个是我使用地址块进行格式化的
,因为我还没想到如何使用CSS获取
同样的结果。
I should mention that my pages have 2 things that don''t validate in
XHTML strict. One is a Google search engine tag, and another is me
using an address block for formatting, because I haven''t yet figured
out how to use CSS to get the same result.



我们有一个CSS问题! < addresselement通过HTML

规范指示文档作者的联系信息。在渲染中没有什么神秘的东西,除了IE奇怪的是用斜体字来表示

默认情况下。对于一般地址(不是文档作者的地址),

最好只使用< divelements,因为实际上没有语义
$ b您可以使用$ b标记。例如,


< div class =" addr">

< div>家庭咨询中心< / div>

< div> 1633 Erringer Rd。 #204< / div>

< div> Simi Valley,CA 93065< / div>

< div> 805-583-3976< / div>

< / span>


然后只需为外部设置任何所需的样式< divor也许为

内部< div> ; s(如果你想影响例如长线的包裹)。如果你想要斜体(为什么?),那么你会使用


..addr {font-style:italic; }


(使用< addressinvalid的东西 - 在正式意义上 -

是你把它放在< span>中。更改< spanto< divwould修复

这个,但标记仍然在语义错误。)


-

Jukka K. Korpela(Yucca)
http:// www.cs.tut.fi/~jkorpela/

We have a CSS question! The <addresselement indicates, by HTML
specifications, contact information for the author of the document. There is
nothing mystic in its rendering, except that IE oddly renders it in italics
by default. For an address in general (not the document author''s address),
it''s best to use just <divelements, since there''s really no semantic
markup you could use. For example,

<div class="addr">
<div>Families Counseling Center</div>
<div>1633 Erringer Rd. #204</div>
<div>Simi Valley, CA 93065</div>
<div>805-583-3976</div>
</span>

Then simply set any desired styling for the outer <divor maybe for the
inner <div>s (if you want to affect e.g. the wrapping of long lines). If you
want italics (why?), then you''d use

..addr { font-style: italic; }

(The thing that makes your use of <addressinvalid - in the formal sense -
is that you have put it inside <span>. Changing <spanto <divwould fix
this, but the markup would still be semantically wrong.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


3月26日00:51,Deborah< deborah1 ... @ sbcglobal.netwrote:
On 26 Mar, 00:51, Deborah <deborah1...@sbcglobal.netwrote:

我应该使用XHTML严格,还是HTML 4.01严格?
Should I be using XHTML strict, or HTML 4.01 strict?



HTML 4.01严格。不要考虑它

(如果你不得不问,你最需要简单的毯子答案)


*那里这里有两个完全不同的问题:XHTML与HTML和

严格与过渡。


*你这样做主要是为了让IE使用 ;标准"渲染不是
quirks,而不是出于任何SGML原因。让它工作正常

首先!


* doctype声明(你在文档中添加的内容)很重要

doctype(它指的是什么)。阅读: http://hsivonen.iki.fi/doctype/

使用此:

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" http://www.w3.org/

TR / html4 / strict.dtd >


*验证很好,但并不是一切。一个熟练的作者可以

仍然会创建一个无效的页面,表现得比一些认真的好 -

out但是有效的页面。验证的主要好处是它的目标是b $ b并且相当简单。规则明确规定,工具免费

并且易于获得。 "质量"更主观!如果您不确定

,请选择有效且0错误。因为那时你_know_它是

有效。


*对于大多数典型的遗留页面,典型的作者会做得更好

将doctypes切换到HTML 4.01严格直接,而不是

Transitional doctype。 Transitional更好的页面实际上是非常罕见的:它们不仅需要作为Strict无效,而且还需要

也是格式良好且有效的Transitional。如果他们不打算按照标准(最常见的情况)接受
,那么你可以直接转向Strict并瞄准高。


如果您提前切换到基于标准的渲染(即使在旧页面上)

那么您可能甚至都不会注意到这一变化。错误是

开始整理CSS并投入精力,而事情仍然处于
怪癖模式,然后改变以后再打破你已经完成的工作。 br />

HTML 4.01 Strict. Don''t even think about it
(If you have to ask, you''re most in need of the simple blanket answer)

* There are two entirely separate issues here: XHTML vs. HTML and
Strict vs. Transitional.

* You''re doing this largely to make IE use "standards" rendering not
"quirks", rather than for any SGML reasons. Get that working right
first!

* The doctype declaration (what you put in your document) matters as
much as the doctype (what it refers to). Read this: http://hsivonen.iki.fi/doctype/
Use this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd" >

* Validation is good, but it''s not everything. A skilled author can
still make an invalid page that behaves better than some badly thought-
out but valid pages. Validation''s main benefit is that it''s objective
and fairly simple. The rules are stated visibly, the tools are free
and easily available. "Quality" is much more subjective! If you''re at
all unsure, go with "valid and 0 errors" because then you _know_ it''s
valid.

* For most typical legacy pages, typical authors will do better by
switching doctypes to HTML 4.01 Strict straightaway, rather than a
Transitional doctype. The pages where Transitional is better are
actually quite rare: they need to be not only non-valid as Strict but
also well-formed and valid as Transitional. If they''re not going to
meet either standard (the most common situation), then you might as
well switch straight to Strict and aim high.

If you switch to standards-based rendering early (even on an old page)
then you probably won''t even notice the change. The mistake is to
start tidying up CSS and putting effort in while things are still in
quirks mode, then change later and break work you''ve already done.


<! - 大型网站的导航元数据(辅助功能):

< link rel =" top" HREF =" index.htm的"标题= QUOT;主页" />
<!-- Navigational metadata for large websites (an accessibility feature):
<link rel="top" href="index.htm" title="Homepage" />



不,不,这只是一个评论。如果你希望它们可见并且可以使用
,那就不要评论它们了!

No it isn''t, that''s just a comment. If you want them to be visible and
usable, then don''t comment them out!


使用地址用于格式化的块,
using an address block for formatting,



你实际上正在使用多个地址块,每行一个。

这里有很多问题:


*< addressmeans"作者的联系信息根据

规范。对于作者的个人文档来说这是可以的,但是当他们正在为第三方创作时,他们不清楚。这是网站管理员,

网页设计师还是网站所有者? (这最近成为英国公司网站的重要法律问题。)


*规范相当强烈暗示'只有一个

< addressper文件,无论它属于谁。


*< address当然不打算逐行使用你知道它是什么呢?



*你的文字有效性问题只是你已经放置了<地址(一个

块元素)里面< span(内联上下文)。


总的来说,用这样简单的东西替换它:


< div class =" sideBarText address" >

家庭咨询中心

< br> 1633 Erringer Rd。 #204

< br> Simi Valley,CA 93065

< br> 805-583-3976

< / div> < br $>

和一个CSS片段

.address {font-style:italic; }


你可能会发现Joe Clark的辅助功能书也很有用
http://joeclark.org/book/sashay/serialization/

You''re actually using multiple address blocks, one for each line.
There are a number of problems here:

* <addressmeans "contact information for an author" according to the
specification. This is OK for the author''s personal documents, but is
unclear when they''re authoring for a 3rd party. Is this the webmaster,
web designer or the site owner? (This has recently become a
significant legal issue for sites of UK companies).

* It''s fairly strongly implied by the spec that there''s only one
<addressper document, no matter who it belongs to.

* <addressis certainly not intended to be used line-by-line, as you
have it.

* Your literal validity issue is just that you''ve placed <address(a
block element) inside <span(an inline context).

On the whole, replace it by something simple like this:

<div class="sideBarText address" >
Families Counseling Center
<br>1633 Erringer Rd. #204
<br>Simi Valley, CA 93065
<br>805-583-3976
</div>

and a CSS fragment of
.address { font-style: italic; }


You''ll probably find Joe Clark''s accessibility book useful too
http://joeclark.org/book/sashay/serialization/

这篇关于来自业余的Doctype问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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