我不知道为什么我有这个麻烦。请看一下截图:
我的CSS看起来像这样:
#tabbase {
display : inline-block;
width : 230px;
height : 173px;
border : 1px solid #3e3e3e;
background-color : #1b1b1b;
box-shadow : 0px 0px 4px 2px rgba(0, 0, 0, 0.4) inset;
margin-top : 6px;
}
#tabbase a {
display : block;
height : 43px;
text-decoration : none;
font-family : 'Nexa Bold';
font-size : 24px;
}
#tabbase a p {
text-align : center;
}
继承人的html:
<div id = "tabbase">
<a id = "blog" href = "#"> <p> Blog </p> </a>
<a class = "batl" href = "#"> <p> Home </p> </a>
<a class = "batl" href = "#"> <p> Contact </p> </a>
<a class = "batl" href = "#"> <p> Samples </p> </a>
</div>
我不知道为什么这在 css 中如此困难,其他一切都很容易。我试过边距、填充、边框、垂直对齐,现在是文本对齐。
为什么它不起作用?
ps:如果有帮助,<a id = "blog">
标签的背景图片是这个css:
#tabbase #blog {
color : #000000;
background-image : url('Tab.png');
}
当我使用跨度时,我得到了这个:
当我添加text-align:center;
到锚标签时,我得到了这个:
https://dl.dropbox.com/u/107533178/Screen%20shot%202012-10-21%20at%202.18.38%20PM.png