0
我發現我的按鈕有很棒的懸停效果,我希望將其放入我的網站。但是,它不起作用。它的代碼片段如下:http://cssdeck.com/labs/fhxam1sb圓形按鈕CSS3懸停不起作用
現在我有下面的代碼,它只給了我一個沒有懸停效果的黑色方塊。我錯過了什麼?
<!DOCTYPE html>
<html>
<head>
<title>Animated Buttons with CSS3</title>
<style media="screen" type="text/css">
// Basic Round Button Layout
a {
color: white;
text-decoration: none;
font-size: 40px;
}
.effect-1 {
position: relative;
height: 100px;
width: 100px;
margin: 100px;
@include border-radius(50%);
display: block;
text-align: center;
line-height: 100px;
font-family: 'Monoton', cursive;
background-color: black;
-webkit-transform: translateZ(0);
&:hover {
background-color: rgba(0,0,0,0.8);
@include transition(background-color 0.2s);
&:after {
@include scale(1);
@include transition(transform 0.2s);
}
}
}
.effect-1:after {
position: absolute;
top:-10px;
left: -10px;
content: '';
height: 100%;
width: 100%;
padding: 10px;
@include border-radius(50%);
@include box-shadow(0 0 0 5px rgba(0,0,0,0.8));
@include scale(0.7);
@include transition(transform 0.2s);
}
</style>
</head>
<body>
<link href='http://fonts.googleapis.com/css?family=Monoton' rel='stylesheet' type='text/css'>
<a href="#" class="btn effect-1">M</a>
</body>
</html>
您發佈的CSS實際上是SASS - 因此,除非您已安裝並運行SASS,否則將不會正確解析「@ include」語句。 – Terry