如何使用 CSS 创建这些按钮?
问问题
94 次
4 回答
1
您需要添加渐变和边框半径
演示http://jsfiddle.net/kevinPHPkevin/SXxz7/1/
.button {
-moz-box-shadow:inset 0px 1px 0px 0px #7af013;
-webkit-box-shadow:inset 0px 1px 0px 0px #7af013;
box-shadow:inset 0px 1px 0px 0px #7af013;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811) );
background:-moz-linear-gradient( center top, #77d42a 5%, #5cb811 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#77d42a', endColorstr='#5cb811');
background-color:#77d42a;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
border:3px solid #268a16;
display:inline-block;
color:#ffffff;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:13px 22px;
text-decoration:none;
}.classname:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #5cb811), color-stop(1, #77d42a) );
background:-moz-linear-gradient( center top, #5cb811 5%, #77d42a 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5cb811', endColorstr='#77d42a');
background-color:#5cb811;
}.classname:active {
position:relative;
top:1px;
}
于 2013-07-14T20:10:38.447 回答
0
您必须将radius:Xpx
属性应用于要制作按钮的项目以及background-color
, border:3px solid (color here)
。
于 2013-07-14T20:06:30.693 回答
0
html
<button type="button" class="cssButton">Salma</button>
CSS:
cssButton {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #ffffff;
padding: 10px 20px;
background: -moz-linear-gradient(
top,
#dbffe0 0%,
#2e9e44);
background: -webkit-gradient(
linear, left top, left bottom,
from(#dbffe0),
to(#2e9e44));
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
border: 2px solid #adadad;
}
于 2013-07-14T20:07:32.603 回答
0
我的尝试:
.myButton{
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: #ffffff;
padding: 14px 40px;
background: -moz-linear-gradient(
top,#6CA44B 0%,#4D872B);
background: -webkit-gradient(
linear, left top, left bottom,
from(#6CA44B),
to(#4D872B));
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
border: 1px solid;
border-top-color:#7B8E70;
border-right-color: #536B44;
border-left-color: #536B44;
border-bottom-color: #4B643D;
box-shadow: 0 0 0 5px #e5e5e5,inset 0 1px rgba(255,255,255,0.3);
text-shadow: 0 1px rgba(0,0,0,0.5);
}
.myButton:hover{
background: #40781F;
box-shadow: 0 0 0 5px #e5e5e5,inset 0 2px rgba(0,0,0,0.3);
color: rgba(255,255,255,0.9);
}
于 2013-07-14T20:48:21.510 回答