修复了 IE9 下的菜单中断问题
所以,我在为我阿姨设计的网站上遇到了问题。请注意,我已经有一段时间没有从头开始开发网站了(这些天我主要使用 Wordpress 主题)。所以在过去的几天里我一直在重新学习 CSS 和 HTML5。也就是说,我遇到了问题并回到表格进行布局(我知道,我知道,上帝帮助我)。
虽然我最终会将此布局转移到纯 CSS,但她的最新书有截止日期,所以我需要加快设计(因此,表格)。我还使用样板作为起点。
目前,一切正常,除了 IE9 中一个非常烦人的怪癖。
我在 IE9 中打破了固定菜单。它现在从页面内容的边缘开始,而不是像其他地方那样跨越页面的整个宽度。
奇怪的是,这个问题在IE8或IE7中不会出现。关于我做错了什么的任何想法。
这是固定菜单的代码:
<div id="container" > OLD SCHOOL TABLED MENU </div>
这是归因于它的 CSS:
#container {width:100%;
height:40px;
background:#8a282c;
position:fixed;
-webkit-box-shadow: 0px 5px 40px #000;
-moz-box-shadow: 0px 5px 40px #000;
box-shadow: 0px 5px 40px #000;
z-index:100;}
我花了一整天的时间在谷歌上搜索答案,但运气不佳。恐怕这个问题目前超出了我的理解范围。任何帮助将不胜感激。提前致谢。
So, I'm having an issue with a website I'm designing for my Aunt. Please note, I haven't worked on a website from scratch in a while (I mostly work with Wordpress themes these days). So I've been relearning CSS and HTML5 over the last couple of days. That said, I've been running into problems and reverting back to TABLES for the layout (I know, I know, god help me).
While, I will eventually move this layout to pure CSS, there was a deadline with her latest book, so I needed to rush the design (hence, the tables). I also used Boilerplate as a starting point.
For now, everything works, with the exception of one REALLY annoying quirk in IE9.
The fixed menu I made breaks in IE9. Rather than spanning the whole width of the page - as it does everywhere else - it now begins at the edge of the page's content.
The page: www.evastachniak.com
Oddly enough, this problem doesn't occur in IE8 or IE7. Any ideas as to what I'm doing wrong.
Here is the code for the fixed menu:
<div id="container" > OLD SCHOOL TABLED MENU </div>
And here is the CSS attributed to it:
#container {width:100%;
height:40px;
background:#8a282c;
position:fixed;
-webkit-box-shadow: 0px 5px 40px #000;
-moz-box-shadow: 0px 5px 40px #000;
box-shadow: 0px 5px 40px #000;
z-index:100;}
I've spent all day searching google for an answer, to little luck. I'm afraid this problem is currently beyond my realm of understanding. Any help would be appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你想添加
left: 0px
- 你没有指定你想要元素的位置,所以默认情况下它就是它在流中的位置。Sounds like you want to add
left: 0px
- you're not specifying where you want the element so by default it's where it would be in the flow.