button标签点击实现数量加减

如上图所示:
标签及样式如下:
  1. .dp_top_amount button{
    float: left;
    width:20px;
    height:22px;
    cursor: pointer;
    background:#fff;
    border:1px solid #ccc;
    }
    .dp_top_amount input{
    float: left;
    height:20px;
    width:36px;
    line-height:20px;
    vertical-align: middle;
    text-align: center;
    border-left: none;
    border-right: none;
    border:1px solid #ccc;
    }
    <divclass="dp_top_amount">
    <span>数量</span>
    <buttontype="button">-</button>
    <inputtype="text"/>
    <buttontype="button">+</button>
    </div>

     

 
 





posted @ 2015-05-05 14:25  专注前端开发3-5年  阅读(535)  评论(0编辑  收藏  举报