我有这个css代码,上面有一个标签。当我将鼠标悬停在它上面时,我把它称为斜角。
这是css:
#slider-next {
padding:10px 60px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
background: -moz-linear-gradient(top, #28c4e3 0%, #0d5664 100%); /* firefox */
text-shadow: 0 1px 2px #fff;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#28c4e3), color-stop(100%,#0d5664)); /* webkit */font-size:20px}
#slider-next:hover {
box-shadow: 0 1px 2px #fff, 0 -1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.8);
-moz-box-shadow: 0 1px 2px #fff, 0 -1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.8);
-webkit-box-shadow: 0 1px 2px #fff, 0 -1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.8);
border: solid #ccc 3px;
}
这是html:
<span id="slider-next" style="float:right"></span>
我想要做的是当我将鼠标悬停在跨栏文本上时,它会斜上去,给出一个效果按钮。现在它向下倾斜。
如何让它弯曲? Here's a fiddle of it.
答案 0 :(得分:0)
只需要对box-shadow
值进行快速调整(我将y
值反转),现在它看起来更像是一个按钮。此外,您的前缀box-shadow
声明应始终位于未加前缀的声明之前。
现场演示:
#slider-next {
padding:10px 60px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
background: -moz-linear-gradient(top, #28c4e3 0%, #0d5664 100%); /* firefox */
text-shadow: 0 1px 2px #fff;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#28c4e3), color-stop(100%,#0d5664)); /* webkit */font-size:20px}
#slider-next:hover {
-moz-box-shadow: 0 -1px 2px #fff, 0 1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 -1px 1px rgba(255,255,255,0.8);
-webkit-box-shadow: 0 -1px 2px #fff, 0 1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 -1px 1px rgba(255,255,255,0.8);
box-shadow: 0 -1px 2px #fff, 0 1px 1px #666, inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 -1px 1px rgba(255,255,255,0.8);
border: solid #ccc 3px;
}
&#13;
<span id="slider-next" style="float:left"></span>
&#13;
JSFiddle版本:http://jsfiddle.net/g7YMV/4/