button按钮背景图及隐藏value的值
简介:这是button按钮背景图及隐藏value的值的详细页面,介绍了和javascript,有关的知识、技巧、经验,和一些javascript源码等。
怎样写button按钮背景图才能让IE6显示?
.goods_buy_info .goods_buy_but .goods_buy_but {
background: url(../images/goods20110309_25.gif);
background-repeat: no-repeat;
background-position: left top;
border:0px;
}
注意点就在background: url(../images/goods20110309_25.gif);
千万不能写成background-img: url(../images/goods20110309_25.gif);
怎样写css才能使button隐藏value值呢?
.goods_buy_info .goods_buy_but .goods_buy_but {
float:left;/*或者float:left|right*/
width:138px;
height:39px;
overflow:hidden;
text-indent:-9999px;
text-transform:capitalize;
border:0px;
}
注意点
1.float:left;/*或者float:left|right*/
2.高度与宽度
3.text-indent一定要足够大
4.最好加上text-transform:capitalize;
下面付上按钮代码:
<style>
.goods_buy_but {
float:left;/*或者float:left|right*/
width:138px;
height:39px;
overflow:hidden;
text-indent:-9999px;
text-transform:capitalize;
background: url(../images/goods20110309_25.gif);
background-repeat: no-repeat;
background-position: left top;
border:0px;
}
</style>
<input class=”goods_buy_but” name=”" type=”submit” value=”提交”/>
“button按钮背景图及隐藏value的值”的更多相关文章 》
实例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提交按钮隐藏value值</title>
</head>
<body>
<input type="submit" style="background:url(ht1.jpg); width:100px; height:25px; border:none;text-indent:-9999px; cursor:pointer;" name="dosubmit" value="注册" />
<input type="submit" value="提交" />
</body>
</html>