填充似乎不起作用。悬停时,填充从容器中出来。谁能告诉我为什么会这样?填充必须在菜单之间留出空白,但不是,而是在悬停时填充从容器中出来。
问问题
103 次
3 回答
0
不明白你想达到什么目的......无论如何,如果你添加到导航 a:hover 这个:
display: inline-block
这是你想要的效果吗?
于 2012-08-18T13:08:12.920 回答
-1
嗨,css 中的一个小错误,你完美地改变了它的工作。这如下;
#nav a {
color: #000000;
padding: 0 20px 0 30px;
text-decoration: none;
}
#nav a:hover {
padding: 0 20px 0 30px;
}
于 2012-08-18T13:06:20.723 回答
-1
必须重写你的 CSS 的某些部分,填充实际上是你,但你需要给 a 标签一个 display: block ; 但是一旦我这样做了,它就把一切都弄乱了,所以我把我弄得一团糟。希望你喜欢。PS 这是在 Mozilla firefox 中测试过的,可能想在其他浏览器中尝试一下。
@font-face {
font-family: "rbno2_light_alternative_Rg";
font-style: normal;
font-weight: normal;
src: url("../fonts/rbno2light_a-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/-webfont.woff") format("woff"), url("../fonts/rbno2light_a-webfont.ttf") format("truetype"), url("../fonts/rbno2light_a-webfont.svg#rbno2_light_alternative_Rg") format("svg");
}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
-x-system-font: none;
border-bottom-color: -moz-use-text-color;
border-bottom-style: none;
border-bottom-width: 0;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
border-left-color-value: -moz-use-text-color;
border-left-style-ltr-source: physical;
border-left-style-rtl-source: physical;
border-left-style-value: none;
border-left-width-ltr-source: physical;
border-left-width-rtl-source: physical;
border-left-width-value: 0;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
border-right-color-value: -moz-use-text-color;
border-right-style-ltr-source: physical;
border-right-style-rtl-source: physical;
border-right-style-value: none;
border-right-width-ltr-source: physical;
border-right-width-rtl-source: physical;
border-right-width-value: 0;
border-top-color: -moz-use-text-color;
border-top-style: none;
border-top-width: 0;
font-family: inherit;
font-size: inherit;
font-size-adjust: inherit;
font-stretch: inherit;
font-style: inherit;
font-variant: inherit;
font-weight: inherit;
line-height: inherit;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style-image: none;
list-style-position: outside;
list-style-type: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
#logo {
float: left;
margin-top: 27%;
width: 372px;
}
#logo h1 {
background-color: #FFFFFF;
display: block;
font-family: rbno2_light_alternative_Rg;
font-size: 2.5em;
letter-spacing: 0.3em;
padding-bottom: 2%;
padding-left: 1%;
padding-right: 2%;
padding-top: 2%;
width: 432px;
}
#nav {
display: block;
float: left;
margin-top: 16%;
width: 100%;
}
#nav ul {
background-color: #FFFFFF;
display: block;
float: left;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
width: 100%;
}
#nav ul li {
color: #000000;
display: block;
float: left;
font-family: rbno2_light_alternative_Rg;
font-size: 1.9em;
}
#nav a {
color: #000000;
display: block;
padding-bottom: 1em;
padding-left: 3em;
padding-right: 3em;
padding-top: 1em;
text-decoration: none;
}
#nav a:hover {
background-color: #000000;
color: white;
}
于 2012-08-18T13:10:12.547 回答