国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > CSS > 正文

用 CSS 讓你的按鈕(button)更加迷人

2024-07-11 08:38:23
字體:
來源:轉載
供稿:網友

查看演示
我們用 A 包含一個 SPAN 標簽來實現(xiàn)此效果:
HTML:


<a class=”button” href=”#”><span>按鈕文字</span></a>

設置按鈕樣式:


<style type=”text/css”>
a.button {
background: transparent url(‘bg_button_a.gif’) no-repeat scroll top right;
color: #444;
display: block;
float: left;
font: normal 12px arial, sans-serif;
height: 24px;
margin-right: 6px;
padding-right: 18px; /* sliding doors padding */
text-decoration: none;
}
a.button span {
background: transparent url(‘bg_button_div.gif’) no-repeat;
display: block;
line-height: 14px;
padding: 5px 0 5px 18px;
}
</style>

為按鈕添加點擊樣式:


<style type=”text/css”>
a.button:active {background-position: bottom right; color: #000; outline: none; /* hide dotted outline in Firefox */ }
a.button:active span { background-position: bottom left; padding: 6px 0 4px 18px; /* push text down 1px */ }
</style>

由于 IE 下點擊后不能還原到默認狀態(tài),因此,我們需要在標簽里添加一段代碼:
<a class="button" href="#" onclick="this.blur(); return false;"><span>按鈕文字</span></a>
如果你需要用它提交表單(FORM),那么可以在 onclick 里面添加一個提交語句,如:document.forms[‘theForm’].submit();

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 呼和浩特市| 穆棱市| 建始县| 柳林县| 万宁市| 贵港市| 砚山县| 鹤岗市| 凤冈县| 门源| 静安区| 四平市| 固始县| 县级市| 奎屯市| 黔西县| 张家界市| 红原县| 阿坝县| 大安市| 吴江市| 衡山县| 盐池县| 启东市| 肥西县| 苍梧县| 明星| 罗田县| 南溪县| 馆陶县| 兴城市| 印江| 繁昌县| 大厂| 汕尾市| 精河县| 东乌珠穆沁旗| 金湖县| 渝中区| 渝中区| 思南县|