2013/2/20 20:26:16作者:佚名來(lái)源:網(wǎng)絡(luò)
在網(wǎng)頁(yè)設(shè)計(jì)中按鈕一般默認(rèn)的都比較“丑”,能不能通過(guò)一些好的樣式來(lái)設(shè)計(jì)呢,下面學(xué)無(wú)憂提供幾款不錯(cuò)的按鈕樣式,希望對(duì)大家有所幫助。
一、帶圖標(biāo)的按鈕
·按鈕樣式截圖
·按鈕樣式代碼如下:
/* CSS Document */
/* BUTTONS */
.buttons a, .buttons button{ display:block; float:left; margin:0 7px 0 0; background-color:#f5f5f5; border:1px solid #dedede; border-top:1px solid #eee; border-left:1px solid #eee;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; font-size:12px; line-height:130%; text-decoration:none; font-weight:bold; color:#565656; cursor:pointer; padding:5px 10px 6px 7px; /* Links */ } .buttons button{ width:auto; overflow:visible; padding:4px 10px 3px 7px; /* IE6 */ } .buttons button[type]{ padding:5px 10px 5px 7px; /* Firefox */ line-height:17px; /* Safari */ } *:first-child+html button[type]{ padding:4px 10px 3px 7px; /* IE7 */ } .buttons button img, .buttons a img{ margin:0 3px -3px 0 !important; padding:0; border:none; width:16px; height:16px; }
/* STANDARD */
button:hover, .buttons a:hover{ background-color:#dff4ff; border:1px solid #c2e1ef; color:#336699; } .buttons a:active{ background-color:#6299c5; border:1px solid #6299c5; color:#fff; }
/* POSITIVE */
button.positive, .buttons a.positive{ color:#529214; } .buttons a.positive:hover, button.positive:hover{ background-color:#E6EFC2;
border:1px solid #C6D880; color:#529214; } .buttons a.positive:active{ background-color:#529214; border:1px solid #529214; color:#fff; }
/* NEGATIVE */
.buttons a.negative, button.negative{ color:#d12f19; } .buttons a.negative:hover, button.negative:hover{ background:#fbe3e4; border:1px solid #fbc2c4; color:#d12f19; } .buttons a.negative:active{ background-color:#d12f19; border:1px solid #d12f19; color:#fff; }
/* REGULAR */
button.regular, .buttons a.regular{ color:#336699; } .buttons a.regular:hover, button.regular:hover{
background-color:#dff4ff; border:1px solid #c2e1ef; color:#336699; } .buttons a.regular:active{ background-color:#6299c5; border:1px solid #6299c5; color:#fff; }
二、圓角按鈕樣式
·按鈕樣式圖片
·樣式代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="" />
<style type="text/css">
<!--
.clear { /* generic container (i.e. div) for floating buttons */
overflow: hidden;
width: 100%;
}
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_span.gif') no-repeat;
display: block;
line-height: 14px;
padding: 5px 0 5px 18px;
}
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>
</head>
<body>
<a class="button" href="http://yzddtk.cn/" onclick="this.blur();"><span>學(xué)無(wú)憂css</span></a>
<a class="button" href="http://yzddtk.cn/" onclick="this.blur();"><span>學(xué)無(wú)憂-yzddtk.cn</span></a>
</body>
</html>
三、帶導(dǎo)角且有背景圖片的按鈕樣式
·按鈕樣式圖片如下:
·按鈕樣式代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src="btn.js"></script>
<style type="text/css" media="screen">
body { padding: 20px; font-size: 0.85em; font-family: georgia, serif; }
.btn { display: block; position: relative; background: #aaa; padding: 5px; float: left; color: #fff; text-decoration: none; cursor: pointer; }
.btn * { font-style: normal; background-image: url(btn2.png); background-repeat: no-repeat; display: block; position: relative; }
.btn i { background-position: top left; position: absolute; margin-bottom: -5px; top: 0; left: 0; width: 5px; height: 5px; }
.btn span { background-position: bottom left; left: -5px; padding: 0 0 5px 10px; margin-bottom: -5px; }
.btn span i { background-position: bottom right; margin-bottom: 0; position: absolute; left: 100%; width: 10px; height: 100%; top: 0; }
.btn span span { background-position: top right; position: absolute; right: -10px; margin-left: 10px; top: -5px; height: 0; }
* html .btn span,
* html .btn i { float: left; width: auto; background-image: none; cursor: pointer; }
.btn.blue { background: #2ae; }
.btn.green { background: #9d4; }
.btn.pink { background: #e1a; }
.btn:hover { background-color: #a00; }
.btn:active { background-color: #444; }
.btn[class] { background-image: url(shade.png); background-position: bottom; }
* html .btn { border: 3px double #aaa; }
* html .btn.blue { border-color: #2ae; }
* html .btn.green { border-color: #9d4; }
* html .btn.pink { border-color: #e1a; }
* html .btn:hover { border-color: #a00; }
p { clear: both; padding-bottom: 2em; }
form { margin-top: 2em; }
form p .btn { margin-right: 1em; }
textarea { margin: 1em 0;}
</style>
</head>
<body>
<p><a href="#" class="btn blue">This is a blue button</a></p>
<p><a href="#" class="btn green">This should be a green button</a></p>
<p><big><a href="#" class="btn blue big">Big Text</a></big></p>
<form method="post" action="#">
<fieldset>
<legend>Form Example</legend>
<div><input type="text" /></div>
<div><textarea cols="40" rows="10"></textarea></div>
<p><input type="Button" id="reset_btn" value="Reset" class="btn" /> <input type="Submit" id="submit_btn" value="Submit this form" class="btn pink" /></p>
</fieldset>
</form>
</body>
</html>
四、較炫的帶導(dǎo)角的按鈕
·按鈕圖片如下:
·按鈕樣式代碼如下:
<!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=iso-8859-1" />
<title>Image Rollover with CSS</title>
<style type="text/css" media="screen">
a.button { background:url(rss-feed-img.png) repeat 0px 0px; width: 123px; height: 44px; display: block; }
a.button span { display: none; }
a.button:hover { background: url(rss-feed-img.png) repeat 0px -44px; }
</style>
</head>
<body>
<a href="#" class="button">
<span>RSS Feeds</span>
</a>
</body>
</html>
以上就是幾款不錯(cuò)的按鈕樣式,你是不是覺(jué)得不錯(cuò)呢。
標(biāo)簽: 幾款不錯(cuò) 按鈕樣式
相關(guān)文章
金山數(shù)據(jù)恢復(fù)大師官方版 v1.0.0.2
詳情南方測(cè)繪Cass10v10.1.6中文
詳情revit 2017
詳情KeyShot Pro 9中文(附安裝教程) v9.0.286
詳情網(wǎng)易新聞客戶端v105.3
詳情AIMP4v5.11.2421中文綠色美化版
詳情onekey一鍵還原v18.0.18.1008
詳情浩辰CAD2020綠色v20.0
詳情好圖網(wǎng)圖標(biāo)轉(zhuǎn)換工具v4.9.7
詳情Adobe indesign cs6
詳情aardiov35.0.0中文最新版
詳情Adobe Creative Cloud 2024簡(jiǎn)體中文v5.3.0.48
詳情暴風(fēng)影音16 v9.04.1029去廣告精簡(jiǎn)版
詳情ASP.NET Maker 2019(ASP.NET代碼生成工具)v12.0.4.0
詳情暴風(fēng)影音v5.92.0824.1111
詳情迅雷5穩(wěn)定版v5.8.14.706
詳情使命召喚17官方中文版 v1.0
詳情死亡之雨新的僵尸病毒中文v1.0綠色免安裝版
詳情輻射4v1.7.15.0整合版
詳情克莉2v1.0中文版
詳情冬日計(jì)劃v1.2中文版
詳情刺客信條英靈殿v1.0吾愛(ài)
詳情刺客信條英靈殿終極v1.0免安裝
詳情動(dòng)物森友會(huì)v1.10.0最新
詳情哈迪斯殺出地獄v1.37中文
詳情嗜血印中文豪華版v1.0豪華版 附游戲攻略秘籍
詳情城市戰(zhàn)斗v1.0中文
詳情尼爾人工生命v1.0steam免費(fèi)
詳情尼爾人工生命升級(jí)版v1.0PC
詳情層層恐懼2中文v1.0綠色免安裝版
詳情往日不再v1.0 steam
詳情往日不再v1.0pc
詳情小生活游戲內(nèi)置MOD版v2.0(57)安卓版
詳情使命召喚手游測(cè)試服最新版v1.9.41安卓版
詳情三國(guó)謀定天下官服v1.2.1安卓版
詳情熱血新手村高爆版v1.0.0安卓版
詳情我養(yǎng)你啊手機(jī)版v1.0.0安卓版
詳情看懂了就很恐怖的故事(細(xì)思極恐)中文版v1.0安卓版
詳情背包英雄中文手機(jī)版v1.1.1安卓版
詳情glow官方版v2.0.9安卓版
詳情三國(guó)大時(shí)代4霸王立志官方正版v1.9安卓版
詳情飛盧小說(shuō)閱讀器手機(jī)版v7.0.7安卓版
詳情牛?;浾Z(yǔ)詞典軟件v20.4.4安卓版
詳情PrettyUp視頻美化瘦身軟件v2.3.0
詳情化學(xué)方程式app中文版v1.1.0.20安卓版
詳情地下城堡3魂之詩(shī)2024安卓最新版v1.2.3安卓版
詳情南方都市報(bào)v6.10.0安卓版
詳情阿修羅之眼正版v1.0.10安卓版
詳情