本文介绍了DIV浮动问题......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 请耐心等待......我是DIV的新手。 为什么以下在IE6中工作,但在NS7中不工作?Please bear with me ... I am a newbie to DIVs.Why does the following work in IE6, but not in NS7? 我刚开始玩DIV。 - DennisI am just starting to play with DIVs.--Dennis推荐答案 [剪辑代码] 我刚开始玩DIV。[snip code] I am just starting to play with DIVs. 好​​的,显然你也开始玩Usenet ;-) 要描述一个问题,请发一个网址,不要指望别人复制 并将你的代码粘贴到文本编辑器中,给它起一个名字,将它上传到他们自己的服务器上,然后查看问题所在。这一点是你的工作。你越容易让别人帮助你,你就会想要帮助你的人越多。 现在,你的问题。您使用的doctype将IE引入Quirks 模式。这基本上意味着它将基本上不遵循其他浏览器所做的 标准。因此,要使IE正确运行 ,请改用此doctype: <!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" " http://www.w3.org/TR/html4/strict.dtd"> 你会看到, IE现在停止做你想做的事了:-) 现在,要让两个div相互浮动,你需要给它们一个b 宽度。 - Els http://locusmeus.com/ Sonhos vem。 Sonhos v?£。 O resto ?? crisfeito。 - Renato Russo -Okay, apparently, you''re also starting to play with Usenet ;-)To describe a problem, please post a URL, don''t expect people to copyand paste your code into a text editor, give it a name, upload it totheir own server, and then look what the problem is. That bit is yourwork. The easier you make it for other people to help you, the morepeople will want to help you.Now, to your problem. The doctype you used, throws IE into Quirksmode. This basically means that it will largely not follow thestandards, which the other browsers do. So, to make IE behavecorrectly, use this doctype instead:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">You will see, that IE stops doing what you want now too :-)Now, to have two divs floated next to each other, you need to givethem a width.--Els http://locusmeus.com/Sonhos vem. Sonhos v?£o. O resto ?? imperfeito.- Renato Russo - 这里有一个提示:如果你想要一个有用的答案,试着描述(a)你想要的b $ b b发生了,(b)实际发生了什么。简单地说它 不起作用让你无处可去。 你的标记更有可能在NS7中正确呈现,而不是在IE6中,但是然后 我不知道你想要做什么首先。 - phil [dot] ronan @ virgin [dot] net http://vzone.virgin.net/phil.ronan/ 那个毫无疑问,这是我的问题的答案。但是,如果我希望第一列的宽度与它包含的任何文本一样宽?离开 IE中的宽度似乎有用......但不适用于NS。 如果你愿意,请随意给我一个很好的教程。 PS我想要做的是重写一个生成HTML的程序。旧的 程序使用TABLE排序所有内容。我想改用DIV。 感谢您的帮助。 - 丹尼斯That is no doubt the answer to my question. But what if I want the width ofthe 1st column to be just as wide as whatever text it contains? Leaving offthe width in IE seems to work ... but not for NS.Feel free to point me to a good tutorial if you would rather.P.S. What I want to do is rewrite a program that generates HTML. The oldprogram lines everything up using TABLEs. I would like to use DIVs instead.Thanks for your help.--Dennis 这篇关于DIV浮动问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-26 18:14
查看更多