パディングが機能していないようです。ホバーすると、パディングがコンテナから出てきます。なぜこれが起こっているのか誰か教えてもらえますか?パディングはメニューの間に空白を与える必要がありますが、そうではありません。代わりに、ホバーするとパディングがコンテナから出てきます。
3 に答える
0
何を達成しようとしているのか理解できません...とにかく、ナビゲーションに追加するとどうなりますか:
display: inline-block
これはあなたが望んでいた効果ですか?
于 2012-08-18T13:08:12.920 に答える
-1
css の小さな間違いが 1 つありましたが、これを完全に変更してください。これは次のとおりです。
#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の一部を書き直す必要があり、パディングは実際にはそこにありますが、タグに 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 に答える