导航边框高度不同
我正在这个网站上工作: http://www.problemio.com 我对 css 知之甚少: )并在 StackOverflow 的帮助下顺利进行。
我再次困惑为什么导航栏中的小垂直线边框高度不同?
理想情况下,我想让它们比字体大小稍短。我有办法做到这一点吗?
谢谢!
这是我的CSS:
.menusystem
{
position: absolute;
font-size: 1em;
color: white;
}
.menusystem ul, .menusystem li
{
margin: 0;
padding: 0;
}
.menusystem li
{
list-style: none outside none;
}
.menusystem ul
{
list-style: none;
}
.menusystem ul li ul
{
display: none;
position: absolute;
top: 1.6em;
right: 0;
}
.menusystem li a
{
text-decoration: none;
}
.menusystem ul li.main_menu_li
{
padding-right: 20px;
padding-left: 20px;
padding-top: 7px;
display: block;
float:right;
margin-right:0.2em;
text-align: center;
border-left: solid 1px white;
line-height: 1em;
}
.menusystem ul li.main_menu_li_left
{
padding-left: 20px;
padding-right: 20px;
padding-top: 7px;
display: block;
float:right;
margin-right:0.2em;
text-align: center;
line-height: 1em;
}
/* IE-Win (Holly hack) reads the list item line breaks, so lets hide those \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
.menusystem li:hover ul, .menusystem li.mouseHover ul {
display: block;
}
.menusystem li ul.child_menu_ul li a
{
color: #fff;
font-size: 80%;
text-shadow: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-bottom: 1px solid #2e6ea4;
border-top: 0px;
background: none repeat scroll 0 0 #2E6EA4;
}
.menusystem li ul.child_menu_ul li.first a
{
-moz-border-radius-topleft: 14px;
-moz-border-radius-topright: 14px;
-webkit-border-top-left-radius: 14px;
-webkit-border-top-right-radius: 14px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
border-top: 1px solid #2e6ea4;
}
.menusystem li ul.child_menu_ul li.last a
{
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-left-radius: 0px;
-webkit-border-top-right-radius: 0px;
-moz-border-radius-bottomleft: 14px;
-moz-border-radius-bottomright: 14px;
-webkit-border-bottom-left-radius: 14px;
-webkit-border-bottom-right-radius: 14px;
}
.menusystem li ul.child_menu_ul li a:hover
{
color: #ff0;
background: #2e6ea4;
}
/*.menusystem li.main_menu_li a */
.menusystem ul.child_menu_ul a
{
color: #fff;
text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}
.menusystem li.main_menu_li a:hover
{
color: orange;
}
I am working on this site: http://www.problemio.com and I have very little clue about css :) and somehow chugging along with the help of StackOverflow.
I am stumped once again as to why the little vertical line borders in the navigation bars are different height?
I would ideally like to make them slightly shorter than the font size. Is there a way for me to do that?
Thanks!
Here is my css:
.menusystem
{
position: absolute;
font-size: 1em;
color: white;
}
.menusystem ul, .menusystem li
{
margin: 0;
padding: 0;
}
.menusystem li
{
list-style: none outside none;
}
.menusystem ul
{
list-style: none;
}
.menusystem ul li ul
{
display: none;
position: absolute;
top: 1.6em;
right: 0;
}
.menusystem li a
{
text-decoration: none;
}
.menusystem ul li.main_menu_li
{
padding-right: 20px;
padding-left: 20px;
padding-top: 7px;
display: block;
float:right;
margin-right:0.2em;
text-align: center;
border-left: solid 1px white;
line-height: 1em;
}
.menusystem ul li.main_menu_li_left
{
padding-left: 20px;
padding-right: 20px;
padding-top: 7px;
display: block;
float:right;
margin-right:0.2em;
text-align: center;
line-height: 1em;
}
/* IE-Win (Holly hack) reads the list item line breaks, so lets hide those \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
.menusystem li:hover ul, .menusystem li.mouseHover ul {
display: block;
}
.menusystem li ul.child_menu_ul li a
{
color: #fff;
font-size: 80%;
text-shadow: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-bottom: 1px solid #2e6ea4;
border-top: 0px;
background: none repeat scroll 0 0 #2E6EA4;
}
.menusystem li ul.child_menu_ul li.first a
{
-moz-border-radius-topleft: 14px;
-moz-border-radius-topright: 14px;
-webkit-border-top-left-radius: 14px;
-webkit-border-top-right-radius: 14px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
border-top: 1px solid #2e6ea4;
}
.menusystem li ul.child_menu_ul li.last a
{
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-left-radius: 0px;
-webkit-border-top-right-radius: 0px;
-moz-border-radius-bottomleft: 14px;
-moz-border-radius-bottomright: 14px;
-webkit-border-bottom-left-radius: 14px;
-webkit-border-bottom-right-radius: 14px;
}
.menusystem li ul.child_menu_ul li a:hover
{
color: #ff0;
background: #2e6ea4;
}
/*.menusystem li.main_menu_li a */
.menusystem ul.child_menu_ul a
{
color: #fff;
text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}
.menusystem li.main_menu_li a:hover
{
color: orange;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们的高度不同,因为它们是边框,并且元素具有不同的高度。
给它们一个统一的高度:
They are different heights because they are borders, and the elements have different heights.
Give them a uniform height: