Firefox 的水平导航位置问题
我正在设计一个网站(新手),我在 Firefox 中遇到了水平导航菜单的问题,我一直遇到这个问题。
这是它在最新的 Safari、Chrome、Webkit (OS X) 中的样子: https://i.sstatic.net/f8pXu.png
这就是它在 Firefox 中的样子5(操作系统): https://i.sstatic.net/daKh6.png
这是我的 CSS,我已经使用伪元素会出现一些问题,因此“丝带”的折叠端是背景图像,
.mod_menu {
width:940px;
height:50px;
background-image:url("tl_files/images/navbg.png");
background-repeat:repeat-x;
}
.mod_menu ul {
margin:10px 0 0 15px;
padding:0;
}
.mod_menu li {
position:relative;
float:left;
border-right:1px solid #247db8;
list-style-type:none;
border-left: 1px solid #005c8e;
}
.mod_menu li a {
display:block;
padding:5px 25px;
font-family:Helvetica, Arial, sans-serif;
font-size:10pt;
color:#ffffff;
text-decoration: none;
text-shadow: 0px -1px 1px #092c47;
}
这是 HTML:
<div id="wrapper">
<div id="header">
<div class="inside">
<div id="logo">
<a href="/index.html">
<img src="tl_files/images/logo_f.png" alt="Logo" />
</a>
</div>
<div class="mod_quicklink block">
<ul>
<li><a href="kontakt.html">Kontakt</a></li>
<li><a href="prihlaseni.html">Přihlášení</a></li>
<li><a href="registrace.html">Registrace</a></li>
</ul>
</div>
<div class="mod_navigation mod_menu block">
<a href="#skipNavigation1" class="invisible">Přeskočit navigaci</a>
<ul class="level_1">
<li class="active first"><a href="index.html" class="first">RL - Corpus</a>
<img id="drop" src="tl_files/img/drop.png" alt="" /></li>
<li class="sibling"><a href="novinky.html" title="Novinky" class="sibling">Novinky</a></li>
<li class="sibling"><a href="zdravotnicka-cinnost.html" title="Zdravotnícka Činnost" class="sibling">Zdravotnícka činnost</a></li>
<li class="sibling"><a href="skolici-cinnost.html" title="Školíci Činnost" class="sibling">Školíci činnost</a></li>
<li class="sibling"><a href="metoda-v-vojty.html" title="Metoda V. Vojty" class="sibling">Metoda V. Vojty</a></li>
<li class="sibling last"><a href="kontakt.html" title="Kontakt" class="sibling last">Kontakt</a></li>
</ul>
<a name="skipNavigation1" id="skipNavigation1" class="invisible"> </a>
</div>
</div>
</div>
</div>
I'm designing a website (newbie) and I came across this problem with horizontal navigation menu in Firefox that I am stuck with.
This is how it looks like in the latest Safari, Chrome, Webkit (OS X):
https://i.sstatic.net/f8pXu.png
This is how it looks like in Firefox 5 (OS X):
https://i.sstatic.net/daKh6.png
Here's my CSS, I've had some problems using pseudo-elements, therefore the fold-ends of the "ribbon" is a background image
.mod_menu {
width:940px;
height:50px;
background-image:url("tl_files/images/navbg.png");
background-repeat:repeat-x;
}
.mod_menu ul {
margin:10px 0 0 15px;
padding:0;
}
.mod_menu li {
position:relative;
float:left;
border-right:1px solid #247db8;
list-style-type:none;
border-left: 1px solid #005c8e;
}
.mod_menu li a {
display:block;
padding:5px 25px;
font-family:Helvetica, Arial, sans-serif;
font-size:10pt;
color:#ffffff;
text-decoration: none;
text-shadow: 0px -1px 1px #092c47;
}
Here's the HTML:
<div id="wrapper">
<div id="header">
<div class="inside">
<div id="logo">
<a href="/index.html">
<img src="tl_files/images/logo_f.png" alt="Logo" />
</a>
</div>
<div class="mod_quicklink block">
<ul>
<li><a href="kontakt.html">Kontakt</a></li>
<li><a href="prihlaseni.html">Přihlášení</a></li>
<li><a href="registrace.html">Registrace</a></li>
</ul>
</div>
<div class="mod_navigation mod_menu block">
<a href="#skipNavigation1" class="invisible">Přeskočit navigaci</a>
<ul class="level_1">
<li class="active first"><a href="index.html" class="first">RL - Corpus</a>
<img id="drop" src="tl_files/img/drop.png" alt="" /></li>
<li class="sibling"><a href="novinky.html" title="Novinky" class="sibling">Novinky</a></li>
<li class="sibling"><a href="zdravotnicka-cinnost.html" title="Zdravotnícka Činnost" class="sibling">Zdravotnícka činnost</a></li>
<li class="sibling"><a href="skolici-cinnost.html" title="Školíci Činnost" class="sibling">Školíci činnost</a></li>
<li class="sibling"><a href="metoda-v-vojty.html" title="Metoda V. Vojty" class="sibling">Metoda V. Vojty</a></li>
<li class="sibling last"><a href="kontakt.html" title="Kontakt" class="sibling last">Kontakt</a></li>
</ul>
<a name="skipNavigation1" id="skipNavigation1" class="invisible"> </a>
</div>
</div>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将 clear: left 添加到类 .mod_menu 中。你的标志浮动到左边,没有清除浮动,那么你的 mod_menu 将尝试在同一行继续(至少在 Firefox 中)。我还推荐 Firebug。
Try adding clear: left to the class .mod_menu. Your logo is floated up to the left, without clearing the floats then you mod_menu will try and continue on the same line (at least in Firefox). I would also recommend Firebug.
您需要清除浮动。
添加
clear:both;
到带有类mod_navigation mod_menu block
的 div 修复了它在 firebug 中的问题。You need to clear your floats.
Adding
clear:both;
to the div with the classmod_navigation mod_menu block
fixed it in firebug.