在 Div 下方添加空间

发布于 2024-08-19 09:57:09 字数 266 浏览 4 评论 0原文

我有一个布局,其中导航是一组彼此堆叠的 div。典型的故事是,“它适用于所有浏览器,除了最糟糕的浏览器 IE。”我希望 IE 中的 div 之间没有任何空格。

这是网址: http://www.drmsmaggio.com/

我以前遇到过这个问题,当时我没有不声明文档类型,但这不是这里的问题,因为有一个文档类型集。

非常感谢任何帮助。

I have a layout in which the navigation is a set of divs stacked on top of each other. Typical stoy, "It works with every browser ever except the worst ones, IE." I want it to not have any space in between the divs in IE.

Here is the URL: http://www.drmsmaggio.com/

I had this problem before when I didn't declare the doctype, but that isn't the problem here because there is a doctype set.

Any help is greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

巨坚强 2024-08-26 09:57:09

首先,我将转向 4.01 严格文档类型而不是过渡文档类型。 Transistional 会在所有浏览器中触发怪异模式,这意味着您最终会遇到这样有趣的小问题。

其次,我将使用重置样式表来删除大部分继承的填充/边距。然后我会在必要时使用 CSS 设置这些填充/边距。

顺便说一句,您应该看到这个问题。 Joel Coehoorn 对于如何构建一致渲染的页面做出了很好的回应。

First, I would move to a 4.01 strict doctype instead of the transitional one. Transistional triggers quirks mode in all the browsers which means that you end up with interesting little problems like this.

Second, I would use a reset style sheet to remove most of the inherited padding / margins. Then I would set those padding / margins using CSS where it was necessary.

btw, you should see this question. Joel Coehoorn had a great response about how to build consistently rendered pages.

杯别 2024-08-26 09:57:09

您可以尝试在 div 上应用一点底部边距,并去掉菜单 div 之间的“间隔”div。

下边距:7px;

You could try applying a little bottom margin to your divs and get rid of the 'spacer' divs that sit between your menu divs.

margin-bottom: 7px;

清旖 2024-08-26 09:57:09

它看起来就像是在“什么是脊椎按摩疗法?”之后。有一段文字是黑色的。这应该是你的一些问题;o)

It looks like right after "What is Chiropractic?" there is a paragraph with text that is black. That should be some of your problem ;o)

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