我有下面的代码来显示按钮中的图像使用CSS,但我无法让它工作。该图像位于CSS文件所在的同一目录中。使用css添加图像
#submit-go {
margin-top:1em;
width:69px;
height:26px;
text-indent:-9999px;
overflow:hidden;
border:0;
background:url(submit-button.gif) no-repeat 0 0;
display:block;
cursor:pointer !important; cursor:hand;
}
#submit-go:hover {
background-position:0 -26px;
}
<div align="center"><button type="submit" id="submit-go" >Submit</button></div>
什么是不工作? 'align'也是一个不推荐的属性 – Adrift 2013-04-28 14:29:28
我建议你尽可能地使用CSS来设计样式,最好不要使用背景图片。看看CSS3渐变,边框半径,方块阴影,文字阴影。 – 2013-04-28 14:30:14
尝试创建一个小提琴(http://jsfiddle.net/)和givin'我们的网址 – Pablo 2013-04-28 14:32:31