IE结构问题

发布于 2024-10-12 18:43:12 字数 405 浏览 6 评论 0原文

我刚刚通过 wordpress 制作了一个非常简单的静态面。然而,我用 html 和 css 从头开始​​制作了这个主题。它看起来很完美,正是我在 FFox、Chrome、Safari 等中想要的......但在 IE 6、7、8 中检查是不正确的。

如果您没有 IE,请点击{此处}查看该网站。 .. 这是它如何渲染的屏幕截图。

alt text

任何关于这可能是什么的想法或关于如何修复它的想法将不胜感激。我在 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.

alt text

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天气好吗我好吗 2024-10-19 18:43:12

在您的文档中,您没有设置 DOCTYPE,因此 ie 被迫以怪异模式显示它。您必须在 html 代码的开头添加 DOCTYPE。您可以在 http://www.w3 找到有关 DOCTYPE 的更多信息.org/QA/2002/04/valid-dtd-list.html

此外,您还可以在 http://www.quirksmode.org/

最后一点,使用 验证您的网页始终很有价值3w 验证器。对您的网站执行此操作,您可以看到:

93 个错误,15 个警告

,列表中的第一个错误如下:

未找到 DOCTYPE!检查与
默认 XHTML 1.0 过渡
文档类型。

找不到 DOCTYPE 声明
或在本文件中得到认可。这
通常意味着该文档是
没有声明其文档类型
顶部。它也可能意味着 DOCTYPE
声明包含拼写错误,
或者它没有使用正确的
语法。

该文档已使用
默认“后备”文​​档类型
定义非常相似
“XHTML 1.0 过渡”。

了解如何将文档类型添加到您的
我们的常见问题解答中的文档。

希望以上所有信息对您了解 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 :

93 Errors, 15 warning(s)

and the first of all in the list is the following:

No DOCTYPE found! Checking with
default XHTML 1.0 Transitional
Document Type.

No DOCTYPE Declaration could be found
or recognized in this document. This
generally means that the document is
not declaring its Document Type at the
top. It can also mean that the DOCTYPE
declaration contains a spelling error,
or that it is not using the correct
syntax.

The document was checked using a
default "fallback" Document Type
Definition that closely resembles
“XHTML 1.0 Transitional”.

Learn how to add a doctype to your
document from our FAQ.

Hope all the above information you be helpful understanding what happens with ie.

随波逐流 2024-10-19 18:43:12

首先,不确定您对 CSS/HTML 开发有多陌生,但是如果您在一个浏览器中创建内容,结果却让 IE 感到恶心并以不同的方式显示某些内容,这并不奇怪。它是网页设计师/开发人员在制作项目时必须携带的拐杖之一。

你做对了,然后你修改一个样式表以获得 IE 的批准。

您需要使用条件注释来附加那些仅适用于 IE 的工作表,甚至可能需要单独为 IE6 / 7 / 8 执行此操作,具体取决于您所做的操作以及它如何破坏外观。

http://www.quirksmode.org/css/condcom.html

此用法示例在 中:

<!--[if IE 6]>
<link rel="stylesheet" href="ie6-fixes.css" />
<![endif]-->

您当然会在 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>:

<!--[if IE 6]>
<link rel="stylesheet" href="ie6-fixes.css" />
<![endif]-->

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.

待天淡蓝洁白时 2024-10-19 18:43:12

通常有一种方法可以让网站在所有浏览器中正确呈现,而无需使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文