我正在尝试为我的表单创建一个按钮,该按钮具有图像背景并在背景顶部显示文本。看起来很简单,但无论我尝试什么,我都在努力让文本出现,并且在搜索了一个小时以找到有类似问题的人后挣扎,所以假设我在做一些愚蠢的事情!
这是我的 CSS:
#detail-left .cart-button {
background : url("../graphics/cart-button.png");
border : none;
color : transparent;
height: 48px;
width: 118px;
padding: 10px;
line-height: 48px;
}
和我的 html:
<input class='cart-button' type='submit' value='Add' />
最佳答案
删除颜色:透明。它使您的文本透明并为其添加一些颜色。
关于html - 输入提交按钮的图像背景和文本 - CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11175759/