為什么第二個雪碧圖效果出不來呢?
<!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>無標(biāo)題文檔</title> <style> *{ ????margin:0;padding:0; ????} .box{ ????width:190px; ????height:250px; ????background-color:#BBFFEE; ????padding:0?20px; ????font-size:14px; } .cont{ ????width:190px; ????height:30px; ????margin:8px?auto; ????text-indent:30px; ????color:#AAAAAA; ????border:1px?solid?#acc3e3; ????border-radius:3px; }???? p?{ ???margin-top:5px; ???font-family:"微軟雅黑"; }???? p?input{ ????margin-right:5px; } p?a{ ????float:right; ????text-decoration:none; } .cont-2,.cont-3{ ????width:100%; ????height:38px; ????margin:12px?auto; } .cont-2{ ????background:url(http://img1.sycdn.imooc.com//539a972b00013e9102280177.jpg)?no-repeat; } .cont-3{ ????background:url(http://img1.sycdn.imooc.com//539a972b00013e9102280177.jpg)?0?-38; } </style> </head> <body> <div?class="box"> ????<form> ????????<input?class="cont"?type="text"?value="郵箱/手機(jī)號/用戶名"/> ????????<input?class="cont"?type="text"?value="請輸入密碼"/> ????????<p> ????????????<input?type="checkbox"?/>下次自動登錄 ????????????<a?href="#">忘記密碼?</a> ????????</p> ????????<input?class="cont-2"type="button"/> ????????<hr> ????????<input?class="cont-3"?type="button"/> ????</form> ???? </div> </body> </html>
不知道是哪里錯了?
2015-12-07
.cont-3{
????background:url(http://img1.sycdn.imooc.com//539a972b00013e9102280177.jpg)?0?-38;
}
這里的-38要加上px
2015-12-06
這樣試一下