Css 移动导航栏上的文本位置

Css 移动导航栏上的文本位置,css,wordpress,navigation,position,Css,Wordpress,Navigation,Position,更新:好的,我更改了#access ul上的边距,但现在当我将鼠标悬停在它上面时,它看起来是这样的: 也可以更改页面标题之间的间距(抱歉,仍在学习css!) 我目前正在设计wordpress主题,想知道如何将文本向上移动一点,使其与导航栏居中: 我也在使用自定义字体。这是我的css: #access { background: #252525; display: block; float: left; margin: 0 auto; height: 40px; } #access ul { li

更新:好的,我更改了#access ul上的边距,但现在当我将鼠标悬停在它上面时,它看起来是这样的:

也可以更改页面标题之间的间距(抱歉,仍在学习css!)

我目前正在设计wordpress主题,想知道如何将文本向上移动一点,使其与导航栏居中:

我也在使用自定义字体。这是我的css:

#access {
background: #252525;
display: block;
float: left;
margin: 0 auto;
height: 40px;
}
#access ul {
list-style: none;
margin: -8px -13px -10px -13px;
padding-left: 0;
color:#000;
text-shadow:1px 1px 1px rgba(14,14,14,0.8);
text-transform:uppercase;
font: 24px Giantypo, Arial, Helvetica, sans-serif;
}
#access li {
float: left;
position: relative;
}
#access a {
display: block;
line-height: 2.5em;
padding: 0 1em;
text-decoration: none;
color:#f3f3f3;
}
#access ul ul {
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
position: absolute;
top: 2em;
left: 0;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #3e5d8c;
line-height: 1em;
padding: .5em .5em .5em 1em;
width: 10em;
height: auto;
}
#access li:hover > a,
#access ul ul :hover > a {
background: #3e5d8c;
}
#access ul ul a:hover {
background: #3e5d8c;
}
#access ul li:hover > ul {
display: block;
}
}
任何帮助都会很好

干杯


Scott

无序列表的顶部边距必须为负值。例如:

margin: -7px 0 0 0;

行高度
设置为等于其
高度
。在
#访问一个
,我相信,但如果没有看到HTML,我无法确定。我不知道它的高度而不去看它的全部实况。

好吧,我在#access ul上更改了边距,虽然现在我在上面悬停时看起来是这样的:在#access上删除线高度或填充物。好吧,我在#access ul上更改了边距,虽然现在我在上面悬停时看起来是这样的:我会把它放在我的网站上,让你看一看。