我必須在jquery mobile中的按鈕中使用自定義圖標。我有我的圖標,它是在button.But我面臨的問題是,默認的圈子出現在我的圖標周圍。我需要刪除這個邊界圓圈,只顯示它的圖標。如何解決這個問題?在jquery mobile中按鈕中使用自定義的矩形圖標
這是HTML我有:
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header" data-theme="b">
<h1>Test</h1>
</div>
<div data-role="content" data-theme="b">
<input type="button" data-inline="true" data-theme="b" data-icon="save-icon" data-iconpos="left" value="Save Data"></a>
</div>
<div data-role="footer" data-position="fixed" data-id="pFooter">
<h1>Test</h1>
</div>
</div>
</body>
</html>
和下面的CSS:
.ui-icon-save-icon{
background: url(save_icon.png) 50% 50% no-repeat; background-size: 19px 21px;
}
你可以在這裏看到它 - http://jsfiddle.net/yPRpt/
請注意,圖標丟失,但你可以在例子中看到圓圈。
太棒了,謝謝你的好主意。他們的關鍵是「透明」。我有一個14x14的圖像,所以添加了「background-size:14px 14px」。我能夠刪除「滾動」並將「0 0」更改爲「2px 2px」。 – DemitryT