課程
/前端開發
/HTML/CSS
/CSS Sprite雪碧圖應用
不知道問題到底在哪里,感覺差了點什么,但找不到。
2015-10-22
源自:CSS Sprite雪碧圖應用 4-1
正在回答
<!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>無標題文檔</title> <style?type="text/css"> *{margin:0;padding:0;} .wrap{ ????width:200px; ????padding:5px?10px; ????background:lightblue; ???} label{font-size:12px;margin-right:50px;} a{color:blue;font-size:12px;}??? .block{ ????width:190px; ????height:38px; ????margin:10px?0; ????font-size:15px; ????text-indent:2em; ????}??? ???? .button?input{ ????????background-image:url(http://img1.sycdn.imooc.com//539a972b00013e9102280177.jpg); ????????height:38px; ????????width:190px; ????????margin:10px?0; ???} .button?>?.c1{background-position:0?0;} .button?>?.c2{background-position:0?-38px;} </style> </head> <body> <div?class="wrap"> ????<form> ????????<input?class="block"?placeholder="郵箱/手機號/用戶名"> ????????<input?class="block"?type="password"?name="密碼"?placeholder="請輸入密碼"> ????????<input?type="checkbox"?name="自動登錄"><label>下次自動登錄</label> ???????? ????????<a>忘記密碼?</a> ???? ??? ????????<div?class="button"> ????????<input?class="c1"?type="button"> ????????<input?class="c2"?type="button"> ????????</div> ????</form> ???? </div> ???? </body> </html>
按鈕的顏色是不一樣的。
.button?>?.c1{background-position:0?0;} .button?>?.c2{background-position:0?-38px;}
修改一下這里就好了。
.button c1{background-position:0 0;}
css是沒有這樣的寫法的。
出世Sunny 提問者
是否是因為您引用錯誤了?
是按鈕的邊框吧!白色那條線?
舉報
必學的大型網站實用技術,讓你快速掌握CSS Sprite雪碧圖技術
2 回答為什么第二個雪碧圖效果出不來呢?
3 回答雪碧圖效率問題
2 回答刷不出雪碧圖啊
3 回答雪碧圖不顯示
1 回答關于雪碧圖
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-10-22
按鈕的顏色是不一樣的。
修改一下這里就好了。
.button c1{background-position:0 0;}
css是沒有這樣的寫法的。
2015-10-22
是否是因為您引用錯誤了?
2015-10-22
是按鈕的邊框吧!白色那條線?