我在使用以下代码时遇到问题。我无法从顶部向下填充 Logo (x12creatiΩns)。我试过 top:10px
如上所述,但它没有做任何事情。
HTML
<div id='header'>
<span id='logo'>
<a href="index.php" id="logo" class="menu" rel="menu">x12creatiΩns</a>
</span>
<span id='sublogo'>Just another portfolio...</span>
</div>`
CSS
span#logo {
font-size:2.2em;
color: black;
padding-left:10px;
text-shadow:0px 1px 0px white;
top:10px;
}
a#logo {
text-decoration: none;
color: black;
}
a#logo:hover {
padding-top:10px;
text-decoration: none;
color: #555;
}
div#header {
background-color:#DDD;
width:100%;
height:44px;
border-bottom-style:solid;
border-bottom-width:1px;
border-bottom-color:#CCC;
}
最佳答案
尝试取下 a
像这样
#logo:hover{}
或者如果你需要访问 anchor 试试这个
#logo a:hover{}
关于CSS 填充和边距不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8608335/