在 Div 下方添加空间
我有一个布局,其中导航是一组彼此堆叠的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,我将转向 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.
您可以尝试在 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;
它看起来就像是在“什么是脊椎按摩疗法?”之后。有一段文字是黑色的。这应该是你的一些问题;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)