用CSS制作返回顶部的向上箭头
发布时间:2018-07-20 20:57:20
作者:ynkulusi
<html>
<head>
<style type="text/css">
p
{
width:0px;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgb(250,0,255,.5);
margin-bottom:0px;
}
#d1
{
width:30px;
height:35px;
background-color:rgb(250,0,255,.5);
text-align:center;
font-size:12px;
}
#d2
{
margin-top:0px;
width:0px;
border-left: 15px solid rgb(250,0,255,.5);
border-right: 15px solid rgb(250,0,255,.5);
border-bottom: 15px solid transparent;
}
</style>
</head>
<body>
<p></p>
<div id="d1">
<a href="#">返回顶部</a>
</div>
<div id="d2"></div>
</body>
</html>
分类:css
评论数:3
阅读数:830
-
2018-08-17 12:45:371<html>
<head>
<style type="text/css">
p.dotted {border-style: dotted}
p.dashed {border-style: dashed}
p.solid {border-style: solid}
p.double {border-style: double}
p.groove {border-style: groove}
p.ridge {border-style: ridge}
p.inset {border-style: inset}
p.outset {border-style: outset}
</style>
</head>
<body>
<p class="dotted">A dotted border</p>
<p class="dashed">A dashed border</p>
<p class="solid">A solid border</p>
<p class="double">A double border</p>
<p class="groove">A groove border</p>
<p class="ridge">A ridge border</p>
<p class="inset">An inset border</p>
<p class="outset">An outset border</p>
</body>
</html> -
2018-08-17 12:46:362通过设置text-shadow的值,来实现文字阴影闪烁的效果,效果如下:
<div class="box">闪烁效果</div>
<style>
.box{
font-size: 20px;
color:#4cc134;
margin: 10px;
animation: changeshadow 1s ease-in infinite ;
/* 其它浏览器兼容性前缀 */
-webkit-animation: changeshadow 1s linear infinite;
-moz-animation: changeshadow 1s linear infinite;
-ms-animation: changeshadow 1s linear infinite;
-o-animation: changeshadow 1s linear infinite;
}
@keyframes changeshadow {
0%{ text-shadow: 0 0 4px #4cc134}
50%{ text-shadow: 0 0 40px #4cc134}
100%{ text-shadow: 0 0 4px #4cc134}
}
/* 添加兼容性前缀 */
@-webkit-keyframes changeshadow {
0%{ text-shadow: 0 0 4px #4cc134}
50%{ text-shadow: 0 0 40px #4cc134}
100%{ text-shadow: 0 0 4px #4cc134}
}
@-moz-keyframes changeshadow {
0%{ text-shadow: 0 0 4px #4cc134}
50%{ text-shadow: 0 0 40px #4cc134}
100%{ text-shadow: 0 0 4px #4cc134}
}
@-ms-keyframes changeshadow {
0%{ text-shadow: 0 0 4px #4cc134}
50%{ text-shadow: 0 0 40px #4cc134}
100%{ text-shadow: 0 0 4px #4cc134}
}
@-o-keyframes changeshadow {
0%{ text-shadow: 0 0 4px #4cc134}
50%{ text-shadow: 0 0 40px #4cc134}
100%{ text-shadow: 0 0 4px #4cc134}
}
</style> -
2018-08-17 12:49:293利用背景图片或者背景渐变,实现文字颜色的闪烁效果,效果如下:
<span class="box">闪烁效果</span>
<style>
.box{
display: inline-block;
font-size: 20px;
margin: 10px;
background: linear-gradient(left, #f71605, #e0f513);
background: -webkit-linear-gradient(left, #f71605, #e0f513);
background: -o-linear-gradient(right, #f71605, #e0f513);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation:scratchy 0.253s linear forwards infinite;
/* 其它浏览器兼容性前缀 */
-webkit-animation:scratchy 0.253s linear forwards infinite;
-moz-animation: scratchy 0.253s linear forwards infinite;
-ms-animation: scratchy 0.253s linear forwards infinite;
-o-animation: scratchy 0.253s linear forwards infinite;
}
@keyframes scratchy {
0% {
background-position: 0 0;
}
25% {
background-position: 0 0;
}
26% {
background-position: 20px -20px;
}
50% {
background-position: 20px -20px;
}
51% {
background-position: 40px -40px;
}
75% {
background-position: 40px -40px;
}
76% {
background-position: 60px -60px;
}
99% {
background-position: 60px -60px;
}
100% {
background-position: 0 0;
}
}
/* 添加兼容性前缀 */
@-webkit-keyframes scratchy {
0% {
background-position: 0 0;
}
25% {
background-position: 0 0;
}
26% {
background-position: 20px -20px;
}
50% {
background-position: 20px -20px;
}
51% {
background-position: 40px -40px;
}
75% {
background-position: 40px -40px;
}
76% {
background-position: 60px -60px;
}
99% {
background-position: 60px -60px;
}
100% {
background-position: 0 0;
}
}
@-moz-keyframes scratchy {
0% {
background-position: 0 0;
}
25% {
background-position: 0 0;
}
26% {
background-position: 20px -20px;
}
50% {
background-position: 20px -20px;
}
51% {
background-position: 40px -40px;
}
75% {
background-position: 40px -40px;
}
76% {
background-position: 60px -60px;
}
99% {
background-position: 60px -60px;
}
100% {
background-position: 0 0;
}
}
@-ms-keyframes scratchy {
0% {
background-position: 0 0;
}
25% {
background-position: 0 0;
}
26% {
background-position: 20px -20px;
}
50% {
background-position: 20px -20px;
}
51% {
background-position: 40px -40px;
}
75% {
background-position: 40px -40px;
}
76% {
background-position: 60px -60px;
}
99% {
background-position: 60px -60px;
}
100% {
background-position: 0 0;
}
}
@-o-keyframes scratchy {
0% {
background-position: 0 0;
}
25% {
background-position: 0 0;
}
26% {
background-position: 20px -20px;
}
50% {
background-position: 20px -20px;
}
51% {
background-position: 40px -40px;
}
75% {
background-position: 40px -40px;
}
76% {
background-position: 60px -60px;
}
99% {
background-position: 60px -60px;
}
100% {
background-position: 0 0;
}
}
</style>