1
A
回答
4
button {
background: orange url(images/icon.png) no-repeat 5px center;
text-align: left;
padding-left: 20px;
}
<button type="submit">Submit</button>
和另一種方式:
button {
postion: relative;
text-align: right;
padding-right: 20px;
}
button img {
position: absolute;
top: 5px;
left: 5px;
}
<button type="submit"><img src="icon.png" /> Submit</button>
0
如果您使用提交輸入按鈕,然後給一些按鈕左填充,並添加圖像作爲非重複的背景圖像的按鈕與CSS。
<input type="submit" class="imageBut submitBut" value="My submit button text" />
CSS:
.imageBut {
padding-left: 30px;
background-position: 0 0; /* Adjust as appropriate */
background-repeat: none;
}
.imageBut.submitBut {
background-image: url(path/to/image.png);
}
0
將沿東西的
input {
padding-left: 24px;
background: url(an-icon.png) 4px 50% no-repeat;
}
工作線?
0
嗯。如何像:
<img src="the-icon"><input type="submit"/>
0
您還可以使用jQuery,像這樣:
$("#button-submit").button({icons: {primary:'ui-icon-play'}});
隨着HTML像這樣:
<input type="submit" name="submit" id="button-submit" /><label for="button-submit">Start</label>
相關問題
- 1. DataTables:在按鈕中的文本旁邊添加圖標
- 2. 在android中添加按鈕文本旁邊的圖標
- 3. 在它旁邊有一個浮動按鈕的css文本框
- 4. 在CSS中的按鈕旁邊添加一個圖標
- 5. 設置集中到一個按鈕旁邊的文本框
- 6. 如何讓文本旁邊的按鈕?
- 7. 按鈕旁邊的輸入文本
- 8. 在文本框旁邊添加一個按鈕
- 9. JQuery datepicker在文本框旁邊添加一個新按鈕
- 10. 將一個按鈕輸入文本的旁邊 - 引導
- 11. 100%輸入文本,它旁邊的一個按鈕 - 如何?
- 12. 在圖標旁邊添加文本
- 13. 輸入文本字段旁邊的按鈕下方的按鈕
- 14. 如何在另一個按鈕旁邊添加另一個按鈕或文本視圖?
- 15. 定位圖標旁邊的按鈕上的文字離子
- 16. 顯示按鈕旁邊的文本按鈕
- 17. 我可以在GWT按鈕旁邊放一個JavaScript按鈕嗎?
- 18. 在表單按鈕css中添加圖像旁邊的文字
- 19. 需要一個HTML標題旁邊的按鈕
- 20. 圖像旁邊的按鈕對齊
- 21. 按鈕在圖像旁邊浮動的按鈕
- 22. 間距導航欄按鈕,這樣一個按鈕旁邊的標題
- 23. 行中引導按鈕旁邊的中心文本
- 24. 如何在xml文件中顯示文本旁邊的圖標?
- 25. 在TinyMCE中顯示一個元素旁邊的按鈕
- 26. Python硒試圖點擊一個用戶名旁邊的按鈕
- 27. 撥動旁邊的文字按鈕
- 28. 如何在應用程序標題旁邊有一個後退按鈕?
- 29. 如何中間對齊按鈕旁邊的文本?
- 30. 如何使用jquery在dropdownlist旁邊添加圖標按鈕
什麼,如果我已經將背景設置爲橙色?? – steve 2011-04-24 19:20:01
查看我編輯的答案 – 2011-04-24 19:21:35
你也可以這樣做:'' – oblig 2011-04-24 19:23:32