前段时间做大屏只学习研究了图表相关内容,但是仅仅是图表会显得有点单调,所以参考优秀大屏展示页面对一些好看的边框进行模仿设计实现。
四角荧光边框
.border1{
border: 2px solid #02a6b5;
width: 100%;
height: 100%;
position: relative;
margin: auto;
box-sizing: border-box;
}
.border1:before{content: '';
position: absolute;
width: 88%;
bottom: -2px;
top: -2px;
left: 6%;
border-bottom: 2px solid #0b3146;
border-top: 2px solid #0b3146;
}
.border1:after{
content: '';
position: absolute;
height: 76%;
left: -2px;
right: -2px;
top: 12%;
border-left: 2px solid #0b3146;
border-right: 2px solid #0b3146;
}
效果图:
内发光边框
.border2{
width: 100%;
height: 100%; color:white; padding: 1rem;
box-shadow: 0 0 3rem rgba(100,200,255,.5) inset;
background: rgba(0,0,0,0);
box-sizing: border-box;
}
效果图:
半透明边框
.border3{
height: 100%; width: 100%; color:rgba(60,240,250,1); font-size: 1.5rem; padding:1rem;
border-radius: .5rem;
border: 1px solid rgba(0,180,220,0.5);
background: linear-gradient(180deg,rgba(0,180,220,0.3),rgba(0,180,220,0.1),rgba(0,180,220,0.1),rgba(0,180,220,0.3));
box-shadow: 0 0 2rem rgba(0,180,220,.1) inset;
box-sizing: border-box;
}
效果图:
角标边框
.border4{
height: 100%; width: 100%;
border: 1px solid rgba(22,78,137,1);
background: rgba(13,35,61,1);
position: relative;
box-sizing: border-box;
}
.border4::after{
content: attr(data-corner);
display: block; position: absolute; top: 0; right: 0;
width: 5rem; padding: 0 1rem; overflow: hidden; text-align: right; color: rgba(255,255,255,.9);
background: linear-gradient(45deg,transparent 0% , transparent 30%, rgba(22,78,137,1) 30%, rgba(22,78,137,1) 100%)
}
效果图:
闪光动画边框
.border5 {
position: relative;
z-index: 0;
width: 100%;
height: 100%;
padding: 1em;
border-radius: 10px;
overflow: hidden;
box-sizing: border-box;
}
.border5::after {
box-sizing: border-box;
content: '';
position: absolute;
z-index: -1;
left: 3px;
top: 3px;
width: calc(100% - 6px);
height: calc(100% - 6px);
background: rgb(14,28,44);
border-radius: 8px;
}
.border5::before {
box-sizing: border-box;
content: '';
position: absolute;
z-index: -2;
left: -50%;
top: -50%;
width: 200%;
height: 200%;
background-color: transparent;
background-repeat: no-repeat;
background-size: 50% 50%, 50% 50%;
background-position: 0 0, 100% 0, 100% 100%, 0 100%;
background-image:
linear-gradient(#02a6b5, #02a6b5), linear-gradient(transparent, transparent),
linear-gradient(#02a6b5, #02a6b5), linear-gradient(transparent, transparent);
-webkit-animation: border5 10s linear infinite;
animation: border5 10s linear infinite;
}
@-webkit-keyframes border5 {
100% {
-webkit-transform: rotate(1turn);
}
}
@keyframes border5 {
100% {
transform: rotate(1turn);
}
}
效果图:
目前只实现了5种边框,以后再有新的边框我会直接更新到这个博客,有需要的小伙伴可以收藏一下。