DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> CSS詳解 >> CSS網頁設計實例:無圖片的網頁按鈕
CSS網頁設計實例:無圖片的網頁按鈕
編輯:CSS詳解     
文章簡介:CSS3制作圓角按鈕,無需圖片.

<!DOCTYPE Html>

<Html lang="en">

<head>
<meta charset="utf-8">
<title>Futurico UI - CSS3 Buttons Tutorial</title>

<!-- Stylesheets -->

<style type="text/CSS">/* prevIEw page style */
body{background:#222;width:1000px;margin:0 auto;}#css,#psd{width:500px;margin:0 auto;}#css{width:550px;padding-top:15px;}a.button{margin-left:69px;}a.big{margin-left:10px;margin-bottom:30px;}hr{border-color:#666;margin-top:50px;}#CSS img {margin-left:20px;}

/*********************************************************************************************
How to Create CSS3 Buttons [Tutorial]
"How to Create CSS3 Buttons" that was specially made for DesignModo by our frIEnd Valeriu Timbuc.

webjx.com

*********************************************************************************************/

.button {
display: inline-block;
position: relative;
margin: 10px;
padding: 0 20px;
text-align: center;
text-decoration: none;
text-shadow: 1px 1px 1px rgba(255,255,255,.22);
font: bold 12px/25px Arial, sans-serif;

-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;

-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 1px 1px 1px rgba(255,255,255,.44);
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 1px 1px 1px rgba(255,255,255,.44);
box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 1px 1px 1px rgba(255,255,255,.44);

-webkit-transition: all 0.15s ease;
-moz-transition: all 0.15s ease;
-o-transition: all 0.15s ease;
-ms-transition: all 0.15s ease;
transition: all 0.15s ease;
}

.button:hover {
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 0px 0px 2px rgba(0,0,0, .5);
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 0px 0px 2px rgba(0,0,0, .5);
box-shadow: 1px 1px 1px rgba(0,0,0,.29), inset 0px 0px 2px rgba(0,0,0, .5);
}

.button:active {
-webkit-box-shadow: inset 0px 0px 3px rgba(0,0,0, .8);
-moz-box-shadow: inset 0px 0px 3px rgba(0,0,0, .8);
box-shadow: inset 0px 0px 3px rgba(0,0,0, .8);
}

/* Big Button Style */

.big {
padding: 0 40px;
padding-top: 10px;
height: 45px;
text-transform: uppercase;
font: bold 20px/22px Arial, sans-serif;
}

.big span {
display: block;
text-transform: none;
font: italic normal 12px/18px Georgia, sans-serif;
text-shadow: 1px 1px 1px rgba(255,255,255, .12);
}

/* Green Color */

.green {
color: #3e5706;

background: #a5cd4e; /* Old browsers */
background: -moz-linear-gradIEnt(top, #a5cd4e 0%, #6b8f1a 100%); /* FF3.6+ */
background: -webkit-gradIEnt(linear, left top, left bottom, color-stop(0%,#a5cd4e), color-stop(100%,#6b8f1a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradIEnt(top, #a5cd4e 0%,#6b8f1a 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradIEnt(top, #a5cd4e 0%,#6b8f1a 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%); /* IE10+ */
background: linear-gradIEnt(top, #a5cd4e 0%,#6b8f1a 100%); /* W3C */
}

/* Blue Color */

.blue {
color: #19667d;

background: #70c9e3; /* Old browsers */
background: -moz-linear-gradIEnt(top, #70c9e3 0%, #39a0be 100%); /* FF3.6+ */
background: -webkit-gradIEnt(linear, left top, left bottom, color-stop(0%,#70c9e3), color-stop(100%,#39a0be)); /* Chrome,Safari4+ */
background: -webkit-linear-gradIEnt(top, #70c9e3 0%,#39a0be 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradIEnt(top, #70c9e3 0%,#39a0be 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #70c9e3 0%,#39a0be 100%); /* IE10+ */
background: linear-gradIEnt(top, #70c9e3 0%,#39a0be 100%); /* W3C */
}

/* Gray Color */

.gray {
color: #515151;

background: #d3d3d3; /* Old browsers */
background: -moz-linear-gradIEnt(top, #d3d3d3 0%, #8a8a8a 100%); /* FF3.6+ */
background: -webkit-gradIEnt(linear, left top, left bottom, color-stop(0%,#d3d3d3), color-stop(100%,#8a8a8a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradIEnt(top, #d3d3d3 0%,#8a8a8a 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradIEnt(top, #d3d3d3 0%,#8a8a8a 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #d3d3d3 0%,#8a8a8a 100%); /* IE10+ */
background: linear-gradIEnt(top, #d3d3d3 0%,#8a8a8a 100%); /* W3C */
}
</style>
<meta name="robots" content="noindex,follow" />
</head>

<body>

<div id="CSS">



<a href="#" class="button big green">sign in <span>One minute</span></a>

<a href="#" class="button big blue">sign in <span>One minute</span></a>

<a href="#" class="button big gray">sign in <span>One minute</span></a>

<br>

<a href="#" class="button green">button</a>

<a href="#" class="button blue">button</a>

<a href="#" class="button gray">button</a>

</div>

<hr>

<div id="psd">

</div>

</body>

</Html>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved