【发布时间】:2013-01-01 23:43:31
【问题描述】:
我注意到我不是第一个询问 CSS 滑动门的人。然而,这似乎(至少在我看来)是一个相当奇怪的问题,我还没有看到答案。
尝试创建一个简单的圆角链接按钮:
html:
<a href="#" class="link_button"><span>Add A New Somthing</span></a>
css:
.link_button {
background: transparent url('img/backgrounds/bg-buttonRight.png') no-repeat scroll top right;
color: #444;
display: block;
float: left;
font: normal 12px arial;
height: 41px;
margin-right: 6px;
padding-right: 14px;
text-decoration: none;
}
.link_button span {
background: transparent url('img/backgrounds/bg-buttonLeft.png') no-repeat top left;
display: block;
line-height: 31px;
padding: 5px 0 5px 14px;
}
.link_button:active {
background-position: bottom right;
color: #000;
outline: none;
}
.link_button:active span {
background-position: bottom left;
padding: 6px 0 4px 18px;
}
结果:
alt text http://www.codefruition.com/sandbox/img/buttonProblems/problemImageOne.jpg
两个图像重叠,这是我想要的,但是为什么会变色?为什么一个会更黑?我尝试使用 png jpg、gif,有和没有透明度。
我posted the code here,以及另一次尝试只使用一个 jpg 而不是两个,但结果仍然相同。
我错过了什么吗?
提前致谢。
【问题讨论】:
标签: css