我可以编制自己的DTD吗? [英] Can I make up my own DTD?

查看:101
本文介绍了我可以编制自己的DTD吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已达成妥协,我使用有效的HTML 4.01,*除了*

,我想使用非标准的bordercolor表的属性。


除了这个黑客/解决方法之外我的代码验证就好了。


所以这里是我的问题 - 可以我自己制作DTD?


Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd ,添加一个

属性为表格规格,保存为
http:/ /www.mysite.com/DTD/even-looser.dtd 并把它放在我自己的

自定义DOCTYPE中?


我意识到这一点是一个有点无意义的练习,纯粹是一个学术问题,但解析器或语法检查器会做什么?我会对你的想法感兴趣。


TIA

解决方案

< blockquote> ho*******@bigfoot.com (Hostile17)写在

news:c6 ************************* @ posting.google.co m:

我已经达成妥协,我使用有效的HTML 4.01,*除了*
我想要使用非标准的bordercolor。表的属性。

我的代码验证正常,除了这个黑客/解决方法。

所以这里是我的问题 - 我可以编制自己的DTD吗? br />
获取 http: //www.w3.org/TR/1999/REC-html40...1224/loose.dtd ,在表格规格中添加一个
属性,保存为
http://www.mysite.com/DTD/even-looser.dtd 把它放在我自己的自定义DOCTYPE中?

我意识到这是一个有点无意义的练习,纯粹是一个学术问题,但解析器或语法检查器会是什么做?我会对你的想法感兴趣。




它会工作得很好;说实话,不要声称你的HTML是

验证其中一个正式版本。


Hostile17写道:

我已达成妥协,我使用有效的HTML 4.01,*除了*
我想使用非标准的bordercolor表的属性。


为什么? CSS的border-color属性有什么问题?

所以这是我的问题 - 我可以编制自己的DTD吗?




抓住 http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd ,添加一个
属性表格规格,保存为
http:// www .mysite.com / DTD / even-looser.dtd 并把它放在我自己的自定义DOCTYPE中?




我意识到这是一个毫无意义的练习,纯粹是一个学术问题,但解析器或语法检查器会做什么?




它会告诉你文件是有效的。该文档不会是HTML,并且

浏览器可能会切换到错误的向后模式(AKA Quirks模式),

但它将是一个有效的SGML文档。


-

David Dorward http://dorward.me.uk/


David Dorward< do ***** @ yahoo.com>在消息新闻中写道:< bk ******************* @ news.demon.co.uk> ...

Hostile17写道:

我已达成妥协,我使用有效的HTML 4.01,*除了*
我想使用非标准的bordercolor表的属性。



为什么? CSS的border-color属性有什么问题?




嗯,这是一个黑客,正如我所说的,但这就是问题所在。 br />

IE'的bordercolor在所有东西周围都有相同的宽度边框。

表本身和每个表格单元格。


相同的宽度我的意思是,如果我在桌子周围有一个边框,

那个外围的1px边框;定义表的

外部的矩形。然后,如果我想在表格单元格周围使用边框,我也可以用CSS做到这一点,但现在我有两个像素,不是吗?桌子周围的

边框和单元格周围的边框。还有

两个像素,其中一个单元格的边框与另一个单元格的边框相交。

Bordercolor做得那么好。


也许我很困惑,我错过了一些关于CSS的东西?


我知道在CSS中做这个的唯一方法就是有一堆复杂的边框

规格,以便最左边的单元格有左边框,最右边的单元格

有一个右边框,但中间的边框有两个等等。


另一种方法是为整个表格设置背景颜色,设置

cellspacing为1并为每个TD设置前景色。这不会对旧版Netscapes产生任何影响 - 并且无论如何都是有效的

?它不是CSS中的属性,只是在HTML中,在TABLE标签中。


我已经离题了。


感谢大家的帮助。


I''ve arrived at a compromise whereby I use valid HTML 4.01, *except*
that I want to use the nonstandard "bordercolor" attribute for tables.

My code validates just fine except for this hack/workaround.

So here''s my question -- can I make up my own DTD?

Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
attribute to the table spec, save it as
http://www.mysite.com/DTD/even-looser.dtd and put that in my own
custom DOCTYPE?

I realise this is a somewhat meaningless exercise, and purely an
academic question, but what would a parser or syntax checker do? I''d
be interested in your thoughts.

TIA

解决方案

ho*******@bigfoot.com (Hostile17) wrote in
news:c6*************************@posting.google.co m:

I''ve arrived at a compromise whereby I use valid HTML 4.01, *except*
that I want to use the nonstandard "bordercolor" attribute for tables.

My code validates just fine except for this hack/workaround.

So here''s my question -- can I make up my own DTD?

Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
attribute to the table spec, save it as
http://www.mysite.com/DTD/even-looser.dtd and put that in my own
custom DOCTYPE?

I realise this is a somewhat meaningless exercise, and purely an
academic question, but what would a parser or syntax checker do? I''d
be interested in your thoughts.



It would work just fine; just be honest and don''t claim that your HTML is
validated against one of the official versions.


Hostile17 wrote:

I''ve arrived at a compromise whereby I use valid HTML 4.01, *except*
that I want to use the nonstandard "bordercolor" attribute for tables.
Why? What''s wrong with the border-color property of CSS?
So here''s my question -- can I make up my own DTD?
Yes
Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
attribute to the table spec, save it as
http://www.mysite.com/DTD/even-looser.dtd and put that in my own
custom DOCTYPE?
Yes
I realise this is a somewhat meaningless exercise, and purely an
academic question, but what would a parser or syntax checker do?



It will tell you the document is valid. The document won''t be HTML, and
browsers will probably switch to buggy backwards mode (AKA Quirks mode),
but it will be a valid SGML document.

--
David Dorward http://dorward.me.uk/


David Dorward <do*****@yahoo.com> wrote in message news:<bk*******************@news.demon.co.uk>...

Hostile17 wrote:

I''ve arrived at a compromise whereby I use valid HTML 4.01, *except*
that I want to use the nonstandard "bordercolor" attribute for tables.



Why? What''s wrong with the border-color property of CSS?



Well it''s a hack, as I said, but here''s the thing.

IE''s bordercolor puts the same width border around everything. The
table itself and every table cell.

By "the same width" I mean that if I have a border around the table,
that''s 1px border around the outside; the rectangle that defines the
outsides of the table. Then if I want borders around the table cells I
can do that with CSS too but now I''ve got two pixels, haven''t I? The
border around the table and the border around the cell. And there are
two pixels where the border of one cell meets the border of another.
Bordercolor does that so well.

Maybe I''m confused and I''m missing something about CSS?

The only way I know to do this in CSS is have a mess of complex border
specs so that the leftmost cell has a left border, the rightmost cell
has a right border but the ones in the middle have both and so on.

The other way is to have a background colour for the whole table, set
cellspacing to 1 and set a foreground colour to each TD. This doesn''t
produce any effect in older Netscapes -- and is cellspacing valid
anyway? It''s not a property in CSS, only in HTML, in the TABLE tag.

I have got SO off-topic.

Thanks for your help everyone.


这篇关于我可以编制自己的DTD吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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