我问问题#3,因为我的网站目前都没有DOCTYPE 语句,但插入DOCTYPE语句有时会搞砸页面的格式。 DIV'不排队,边界并不总是正确的, JavaScripts(我已下载)不会以同样的方式工作。此外,水平的滚动条显示在他们之前的地方。但是当我验证页面时,验证器并没有显示受影响的元素有什么问题。 例如:在我的个人主页上,我有一个< DIV>橙色点缀边框,在一个框架内排成一行。它按照我的预期方式很好地排列。但是当我插入< Transitional> doctype,div延伸到页面上,文本不合适。 所以我只是想知道它们有多重要。最终我想验证我的所有页面并包含doctypes。如果有人有兴趣,这里是我的两个网站。提前感谢您的回复。 http:// home。 comcast.net/~vikenk http://www.sayatnova.com 您是否真的试图验证您的网页?您是否曾使用除IE之外的任何其他浏览器查看您的页面?b ?如果没有,你应该。 home.comcast.net/~vikenk的 首页在mozilla中看起来非常好, 而且'* *不是* Mozilla'的错:) 添加doctype声明然后验证 http://validator.w3.org/ (HTML) http://jigsaw.w3.org/css-validator/ (CSS) 您的CSS中有几个严重错误。 - / Arne 现在杀死所有不报价的顶级海报和海报 *如何发布: http://www.cs.tut.fi /〜jkorpela/usenet/brox.html *来自Google: http://www.safalra.com/special/googlegroupsreply/ ------------------ --------------- ---------------------------- Viken Karaguesian写道: 1.是doctype语句*必需*,还是只是强烈建议?我可能会使用Transitional doctype。 新文档应该使用严格的doctype。 Transitional是针对旧遗留页面的轻微更新,您不想花时间去完成 工作,例如将表示代码移除到CSS样式表中。 <!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" " http://www.w3。 org / TR / html4 / strict.dtd"> 请参阅:< http://www.w3.org/QA/2002/04/valid-dtd-list。 html> 此外,google为框架是邪恶的 - -bts -当摩托车,从不跟随猪车 >你真的试过验证你的网页吗?您是否曾使用除IE以外的任何其他浏览器查看您的网页?如果没有,你应该。 home.comcast.net/~vikenk的首页在mozilla中看起来非常好,而且*不是* Mozilla的错::) 是的,我有,而且他们不能很好地验证。 :>(我知道我的网页在Mozzila看起来如何并且无法弄清楚为什么会这样。我是 不是很了解html,所以我正在努力深入了解 弄清楚为什么会这样。看起来在Opera中看起来很好,但有些是 颜色看起来有点偏。 Hello all,I''m somewhat of a newbie to webscripting. I''ve made a couple of websites inthe past with WYSIWYG software, but now I''m much more interested in manualscripting. I have some questions about DOCTYPE:1. Is a doctype statement *required*, or is it just "strongly suggested"? Iwould probably be using a Transitional doctype.2. I understand that in a frameset I must use a Framset Doctype ststement,but what about the individual pages within the frameset? Must I use theFrameset Doctype statement in those pages as well? Would they even have adoctype at all, or is the Frameset doctype enough?3. Does a doctype statement actually *do* anything, or is it just adeclaration that you''re following a standard?I ask question #3 because none of my websites currently have a DOCTYPEstatement, but inserting a DOCTYPE statement sometimes screws up theformatting of the page. DIV''s don''t line up, borders aren''t always right,JavaScripts (that I''ve downloaded) don''t work the same way. Also, horizontalscroll bars show up where they weren''t before. But when I validate the page,the validator doesn''t show anything wrong with the elements that areaffected.For instance: In my personal homepage, I have a <div> with an orange dottedborder that''s lined up within a frame. It lines up nicely the way I intendedit. But when I insert the <Transitional> doctype, the div stretches acrossthe page and the text doesn''t fit right.So I''m just wondering how important they are. Eventually I want to validateall my pages and include doctypes. Just in case anyone is interested, hereare two of my sites. Thanks in advance for any replies. http://home.comcast.net/~vikenk http://www.sayatnova.com--Viken K. http://home.comcast.net/~vikenk 解决方案 Once upon a time *Viken Karaguesian* wrote: Hello all, I''m somewhat of a newbie to webscripting. I''ve made a couple of websites in the past with WYSIWYG software, but now I''m much more interested in manual scripting. I have some questions about DOCTYPE: 1. Is a doctype statement *required*, or is it just "strongly suggested"? I would probably be using a Transitional doctype.A: It''s *required* if you want the page to validate, and even if notit''s "strongly suggested".Use a full doctype (with the link)<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> 2. I understand that in a frameset I must use a Framset Doctype ststement, but what about the individual pages within the frameset? Must I use the Frameset Doctype statement in those pages as well? Would they even have a doctype at all, or is the Frameset doctype enough?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN""http://www.w3.org/TR/html4/frameset.dtd">Goes only in the frameset file, transitional to all other individualpages. 3. Does a doctype statement actually *do* anything, or is it just a declaration that you''re following a standard?Yes, it does. It makes the browsers render the pages without guessingwhat they should look like, when rendering them in Standard Mode andnot in Quirks Mode. I ask question #3 because none of my websites currently have a DOCTYPE statement, but inserting a DOCTYPE statement sometimes screws up the formatting of the page. DIV''s don''t line up, borders aren''t always right, JavaScripts (that I''ve downloaded) don''t work the same way. Also, horizontal scroll bars show up where they weren''t before. But when I validate the page, the validator doesn''t show anything wrong with the elements that are affected. For instance: In my personal homepage, I have a <div> with an orange dotted border that''s lined up within a frame. It lines up nicely the way I intended it. But when I insert the <Transitional> doctype, the div stretches across the page and the text doesn''t fit right. So I''m just wondering how important they are. Eventually I want to validate all my pages and include doctypes. Just in case anyone is interested, here are two of my sites. Thanks in advance for any replies. http://home.comcast.net/~vikenk http://www.sayatnova.comHave you really tried to validate your pages? Have you ever looked onyour pages with any other browser than IE? If not, you should. Thefront page for home.comcast.net/~vikenk looks very emty in mozilla,and that''s *not* Mozilla''s fault :)Add the doctype declarations and then validate on http://validator.w3.org/ (HTML) http://jigsaw.w3.org/css-validator/ (CSS)You have several serious errors in your CSS.--/ArneNow killing all top posters and posters who don''t quote* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html* From Google: http://www.safalra.com/special/googlegroupsreply/-------------------------------------------------------------Viken Karaguesian wrote: 1. Is a doctype statement *required*, or is it just "strongly suggested"? I would probably be using a Transitional doctype.New documents should use a Strict doctype. Transitional is for minorupdates to old legacy pages where you don''t want to take the time to dowork such as remove presentational code into a CSS stylesheet.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">See: <http://www.w3.org/QA/2002/04/valid-dtd-list.html>Also, google for "frames are evil"---bts-When motorcycling, never follow a pig truck> Have you really tried to validate your pages? Have you ever looked on your pages with any other browser than IE? If not, you should. The front page for home.comcast.net/~vikenk looks very emty in mozilla, and that''s *not* Mozilla''s fault :)Yes, I have, and they don''t validate well. :>( I know how my webpage looksin Mozzila and have not been able to figure out why it looks like that. I''mnot very knowledgeable about html, so I''m trying to get more in depth tofigure out why it''s that way. It seems to look fine in Opera, but some ofthe colors seem a bit off. 这篇关于各种DOCTYPE问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!