html 波旁苦涩按钮实验
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 波旁苦涩按钮实验相关的知识,希望对你有一定的参考价值。
<a href="#" class="btn btn-primary"><span class="dashed">I'm a link</span></a>
<a href="#" class="btn btn-success"><span class="dashed">I'm a link</span></a>
<a href="#" class="btn btn-stripped">Alert !</a>
<hr>
<h2>Patterns</h2>
<div class="pattern dot-pattern"></div>
<div class="pattern triangle-pattern"></div>
<div class="pattern saw-pattern"></div>
/* # Bourbon Buttons
Just playing with bourbon buttons
.btn-success -
.btn-primary -
Markup:
<a href="#" class="$modifierClass"><span class="dashed">I'm a link</span></a>
<p class="$modifierclass"><span class="dashed">I'm a link</span></p>
<button class="$modifierclass"><span class="dashed">I'm a link</span></button>
Styleguide bourbon.buttons
*/
button,
input[type="submit"] {
-webkit-font-smoothing: antialiased;
background-color: #477DCA;
border-radius: 0.1875em;
color: white;
display: inline-block;
font-size: 1em;
font-weight: bold;
line-height: 1;
padding: .75em 1em;
text-decoration: none;
}
button:hover,
input[type="submit"]:hover {
background-color: #2c5999;
color: white;
}
body {
-webkit-font-smoothing: antialiased;
background-color: white;
color: #333;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1em;
line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
line-height: 1.25em;
margin: 0;
text-rendering: optimizeLegibility;
}
h1 {
font-size: 2.25em;
}
h2 {
font-size: 2em;
}
h3 {
font-size: 1.75em;
}
h4 {
font-size: 1.5em;
}
h5 {
font-size: 1.25em;
}
h6 {
font-size: 1em;
}
p {
margin: 0 0 0.75em;
}
a {
-webkit-transition: color 0.1s linear;
-moz-transition: color 0.1s linear;
transition: color 0.1s linear;
color: #477DCA;
text-decoration: none;
}
a:hover {
color: #2c5999;
}
a:active, a:focus {
color: #2c5999;
outline: none;
}
hr {
border-bottom: 1px solid #DDD;
border-left: none;
border-right: none;
border-top: none;
margin: 1.5em 0;
}
img {
margin: 0;
max-width: 100%;
}
blockquote {
border-left: 2px solid #DDD;
color: #595959;
margin: 1.5em 0;
padding-left: 0.75em;
}
cite {
color: #737373;
font-style: italic;
}
cite:before {
content: '\2014 \00A0';
}
fieldset {
background: #f7f7f7;
border: 1px solid #DDD;
margin: 0 0 0.75em 0;
padding: 1.5em;
}
input,
label,
select {
display: block;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1em;
}
label {
font-weight: bold;
margin-bottom: 0.375em;
}
label.required:after {
content: "*";
}
label abbr {
display: none;
}
textarea,
input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"],
select[multiple=multiple] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: border-color;
-moz-transition: border-color;
transition: border-color;
background-color: white;
border-radius: 0.1875em;
border: 1px solid #DDD;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1em;
margin-bottom: 0.75em;
padding: 0.5em 0.5em;
width: 100%;
}
textarea:hover,
input[type="email"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="url"]:hover, input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="month"]:hover, input[type="time"]:hover, input[type="week"]:hover,
select[multiple=multiple]:hover {
border-color: #c4c4c4;
}
textarea:focus,
input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus,
select[multiple=multiple]:focus {
border-color: #477DCA;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 5px rgba(55, 112, 192, 0.7);
outline: none;
}
textarea {
resize: vertical;
}
input[type="search"] {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
input[type="checkbox"], input[type="radio"] {
display: inline;
margin-right: 0.375em;
}
input[type="file"] {
margin-bottom: 0.75em;
padding-bottom: 0.5em;
width: 100%;
}
select {
width: auto;
max-width: 100%;
margin-bottom: 1.5em;
}
table {
border-collapse: collapse;
margin: 0.75em 0;
table-layout: fixed;
width: 100%;
}
th {
border-bottom: 1px solid #b7b7b7;
font-weight: bold;
padding: 0.75em 0;
text-align: left;
}
td {
border-bottom: 1px solid #DDD;
padding: 0.75em 0;
}
tr, td, th {
vertical-align: middle;
}
ul, ol {
margin: 0;
padding: 0;
list-style-type: none;
}
dl {
margin-bottom: 0.75em;
}
dl dt {
font-weight: bold;
margin-top: 0.75em;
}
dl dd {
margin: 0;
}
button,
input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
border: none;
cursor: pointer;
user-select: none;
vertical-align: middle;
white-space: nowrap;
}
.btn-primary {
border: 1px solid #076fe4;
border-radius: 3px;
box-shadow: inset 0 1px 0 0 #8ebcf1;
color: white;
display: inline-block;
font-size: inherit;
font-weight: bold;
background-color: #4294f0;
background-image: -webkit-linear-gradient(#4294f0, #0776f3);
background-image: linear-gradient(#4294f0, #0776f3);
padding: 7px 18px;
text-decoration: none;
text-shadow: 0 1px 0 #0065d6;
background-clip: padding-box;
padding: 3px 3px;
}
.btn-primary:hover:not(:disabled) {
box-shadow: inset 0 1px 0 0 #60a2ec;
cursor: pointer;
background-color: #2f87ea;
background-image: -webkit-linear-gradient(#2f87ea, #086fe3);
background-image: linear-gradient(#2f87ea, #086fe3);
}
.btn-primary:active:not(:disabled), .btn-primary:focus:not(:disabled) {
border: 1px solid #076fe4;
box-shadow: inset 0 0 8px 4px #0868d3, inset 0 0 8px 4px #0868d3;
}
.btn-primary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-primary .dashed {
border-radius: 0.1875em;
border-color: rgba(0, 0, 204, 0.5);
}
.btn-primary:hover {
color: white;
text-shadow: 2px 2px 1px #000;
}
.btn-success {
border: 1px solid #082c08;
border-color: #082c08 #021303 black;
border-radius: 16px;
box-shadow: inset 0 1px 0 0 #04a301;
color: white;
display: inline-block;
font-size: inherit;
font-weight: normal;
line-height: 1;
background-color: green;
background-image: -webkit-linear-gradient(green, #004d0a);
background-image: linear-gradient(green, #004d0a);
padding: 7px 18px;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px #052f08;
background-clip: padding-box;
padding: 3px 3px;
}
.btn-success:hover:not(:disabled) {
border: 1px solid #021302;
border-color: #021302 black black;
box-shadow: inset 0 1px 0 0 #018f01;
cursor: pointer;
background-color: #006900;
background-image: -webkit-linear-gradient(#006900, #013007);
background-image: linear-gradient(#006900, #013007);
text-shadow: 0 -1px 1px #000f02;
background-clip: padding-box;
}
.btn-success:active:not(:disabled), .btn-success:focus:not(:disabled) {
background: #054809;
border: 1px solid black;
border-bottom: 1px solid black;
box-shadow: inset 0 0 6px 3px #001203;
text-shadow: 0 -1px 1px #011102;
}
.btn-success:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-success .dashed {
border-radius: 16px;
border-color: rgba(0, 179, 0, 0.5);
box-shadow: 1px 0 3px #000;
}
.btn-success:hover {
color: white;
}
.dashed {
border: 1px dashed;
padding: .25em .65em;
font-size: 2em;
line-height: 1.8em;
margin: 0;
}
.btn-stripped {
border: 1px solid #3371b2;
border-color: #3371b2 #2457a3 #164297;
border-radius: 16px;
box-shadow: inset 0 1px 0 0 #64a9f2;
color: white;
display: inline-block;
font-size: inherit;
font-weight: normal;
line-height: 1;
background-color: #4294f0;
background-image: -webkit-linear-gradient(#4294f0, #0156fe);
background-image: linear-gradient(#4294f0, #0156fe);
padding: 7px 18px;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 1px #2762bf;
background-clip: padding-box;
font-size: 2em;
box-shadow: 2px 2px 5px black;
background: repeating-linear-gradient(-55deg, #7f8000, #7f8000 10px, #191a00 10px, #191a00 20px);
color: yellow;
}
.btn-stripped:hover:not(:disabled) {
border: 1px solid #2062a7;
border-color: #2062a7 #0e479a #01318e;
box-shadow: inset 0 1px 0 0 #519cf0;
cursor: pointer;
background-color: #2d88ee;
background-image: -webkit-linear-gradient(#2d88ee, #1554ce);
background-image: linear-gradient(#2d88ee, #1554ce);
text-shadow: 0 -1px 1px #134faf;
background-clip: padding-box;
}
.btn-stripped:active:not(:disabled), .btn-stripped:focus:not(:disabled) {
background: #226edd;
border: 1px solid #0d3c8c;
border-bottom: 1px solid #062d8d;
box-shadow: inset 0 0 6px 3px #0c44b8;
text-shadow: 0 -1px 1px #1a52aa;
}
.btn-stripped:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-stripped:hover {
box-shadow: 2px 2px 5px black;
background-image: repeating-linear-gradient(-55deg, #7f8000, #7f8000 10px, #191a00 10px, #191a00 20px);
}
.pattern {
width: 200px;
height: 200px;
display: block;
}
.dot-pattern {
background: radial-gradient(circle, #800080, #800080 50%, #4b026f 50%, #4b026f);
background-size: 20px 20px;
}
.triangle-pattern {
color: white;
background: linear-gradient(45deg, #5d9634, #5d9634 50%, #538c2b 50%, #538c2b);
background-size: 20px 10px;
}
.saw-pattern {
color: white;
background: linear-gradient(45deg, #5d9634, #5d9634 50%, #538c2b 50%, #538c2b);
background-size: 20px 10px;
}
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// Bitters (v0.10.0)
// Bourbon (v4.0.2)
// ----
/* # Bourbon Buttons
Just playing with bourbon buttons
.btn-success -
.btn-primary -
Markup:
<a href="#" class="$modifierClass"><span class="dashed">I'm a link</span></a>
<p class="$modifierclass"><span class="dashed">I'm a link</span></p>
<button class="$modifierclass"><span class="dashed">I'm a link</span></button>
Styleguide bourbon.buttons
*/
@import "bourbon/bourbon";
@import "bitters/bitters";
// @import "neat/neat";
// ??
.btn{
//padding: 3px 3px;
}
.btn-primary{
@include button();
padding: 3px 3px;
.dashed{
border-radius:$base-border-radius;
border-color: darken(rgba(blue,0.5), 10%);
}
&:hover {
color:white;
text-shadow: 2px 2px 1px #000;
}
}
.btn-success{
@include button(pill, green);
padding: 3px 3px;
.dashed{
border-radius:16px;
border-color: lighten(rgba(green,0.5), 10%);
box-shadow:1px 0 3px #000;
}
&:hover {
color:white;
}
}
.dashed{
border:1px dashed;
padding: .25em .65em;
font-size: 2em;
line-height: 1.8em;
margin: 0;
}
// http://css-tricks.com/stripes-css/
$stripped-alert: repeating-linear-gradient(
-55deg,
darken(yellow,25%),
darken(yellow,25%) 10px,
darken(yellow,45%) 10px,
darken(yellow,45%) 20px
);
.btn-stripped {
@include button(pill);
font-size:2em;
box-shadow:2px 2px 5px black;
background: repeating-linear-gradient(
-55deg,
darken(yellow,25%),
darken(yellow,25%) 10px,
darken(yellow,45%) 10px,
darken(yellow,45%) 20px
);
color:yellow;
&:hover {
box-shadow:2px 2px 5px black;
background-image: repeating-linear-gradient(
-55deg,
darken(yellow,25%),
darken(yellow,25%) 10px,
darken(yellow,45%) 10px,
darken(yellow,45%) 20px
);
}
}
.pattern {
width:200px;
height:200px;
display:block;
}
.dot-pattern {
background: radial-gradient(
circle,
purple,
purple 50%,
#4b026f 50%,
#4b026f
);
background-size: 20px 20px;
}
.triangle-pattern {
color: white;
background: linear-gradient(
45deg,
#5d9634,
#5d9634 50%,
#538c2b 50%,
#538c2b
);
background-size: 20px 10px;
}
.saw-pattern{
color: white;
background: linear-gradient(
45deg,
#5d9634,
#5d9634 50%,
#538c2b 50%,
#538c2b
);
background-size: 20px 10px;
}
<a href="#" class="btn btn-primary"><span class="dashed">I'm a link</span></a>
<a href="#" class="btn btn-success"><span class="dashed">I'm a link</span></a>
<a href="#" class="btn btn-stripped">Alert !</a>
<hr>
<h2>Patterns</h2>
<div class="pattern dot-pattern"></div>
<div class="pattern triangle-pattern"></div>
<div class="pattern saw-pattern"></div>
以上是关于html 波旁苦涩按钮实验的主要内容,如果未能解决你的问题,请参考以下文章