IE结构问题
我刚刚通过 wordpress 制作了一个非常简单的静态面。然而,我用 html 和 css 从头开始制作了这个主题。它看起来很完美,正是我在 FFox、Chrome、Safari 等中想要的......但在 IE 6、7、8 中检查是不正确的。
如果您没有 IE,请点击{此处}查看该网站。 .. 这是它如何渲染的屏幕截图。
任何关于这可能是什么的想法或关于如何修复它的想法将不胜感激。我在 css 中找不到任何语法错误,html 似乎是正确的
谢谢
I have just made a very simple static side via wordpress. However, I made the theme from scratch with html and css. It looks perfect and exactly how I want in FFox,Chrome,Safari etc...but upon inspection in IE 6,7,8 is is not right.
Click {here} to see the site and if you don't have IE... Here is a screen shot of how it is rendering in there.
Any idea on what this may be or an idea on how to fix it would be greatly appreciated. I can't find any syntax errors in my css and the html seems right
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在您的文档中,您没有设置 DOCTYPE,因此 ie 被迫以怪异模式显示它。您必须在 html 代码的开头添加 DOCTYPE。您可以在 http://www.w3 找到有关 DOCTYPE 的更多信息.org/QA/2002/04/valid-dtd-list.html
此外,您还可以在 http://www.quirksmode.org/
最后一点,使用 验证您的网页始终很有价值3w 验证器。对您的网站执行此操作,您可以看到:
,列表中的第一个错误如下:
希望以上所有信息对您了解 ie 发生的情况有所帮助。
In your document you don't set a DOCTYPE, so ie is forced to show it in quirks mode. You have to add the DOCTYPE in the start of your html code. You can find more information about DOCTYPE at http://www.w3.org/QA/2002/04/valid-dtd-list.html
Also you can find more information about quirks mode at http://www.quirksmode.org/
As last note, it's always valuable to validate your webpages using 3w validator. Doing this with your website, you can see that you get :
and the first of all in the list is the following:
Hope all the above information you be helpful understanding what happens with ie.
首先,不确定您对 CSS/HTML 开发有多陌生,但是如果您在一个浏览器中创建内容,结果却让 IE 感到恶心并以不同的方式显示某些内容,这并不奇怪。它是网页设计师/开发人员在制作项目时必须携带的拐杖之一。
你做对了,然后你修改一个样式表以获得 IE 的批准。
您需要使用条件注释来附加那些仅适用于 IE 的工作表,甚至可能需要单独为 IE6 / 7 / 8 执行此操作,具体取决于您所做的操作以及它如何破坏外观。
http://www.quirksmode.org/css/condcom.html
此用法示例在
中:
您当然会在 ie 之前拥有“默认”样式表,并且 ie.css 将覆盖最初定义的样式。
只有正确的方法才能做到这一点。
Well for one, not sure how new you are to CSS/HTML development, but this is NEVER a surprise that you create content in one browser only to have IE puke and choke and display something differently. Its one of the crutches that web designers / developers have to carry when making projects.
You make it right, then you mod a stylesheet to be IE approved.
You need to use conditional comments to attach those IE only sheets, and you might even have to do it for IE6 / 7 / 8 seperately, depending on what you did and how it breaks the look.
http://www.quirksmode.org/css/condcom.html
Example of this usage in the
<head>
:You would of course have your 'default' style sheet BEFORE the ie one, and the ie.css would overwrite the initially defined styles.
Only correct way to go about it.
通常有一种方法可以让网站在所有浏览器中正确呈现,而无需使用 IE 模板,但这需要一些工作。
尝试添加 margin-left: auto;右边距:自动;和/或宽度:100% 到您的身体。
此外,将需要存在于同一 y 轴上的内容(例如选项卡和内容)包装在 div 中也是一种很好的做法,以便它们可以一起移动。
There is usually a way to have a website render in all browsers correctly without using an IE template, but it takes a bit of work.
Try adding margin-left: auto; and margin-right: auto; and/or width:100% to your body.
Also it is good practice to wrap things that need to exist on the same y-axis, such as your tab and content in a div so that they can move together.