css幽灵按钮
2017-05-01 20:38
155 查看
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
*{
margin: 0;
padding: 0;
}
body{
background-color: rgba(38,50,56,1);
}
html,body{
height: 100%;
}
div{
width: 200px;
height: 50px;
text-align: center;
line-height: 50px;
color: rgba(255,255,255,.1);
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%,50%);
border: rgba(255,255,255,.03) solid 1px;
cursor: pointer;
perspective: 500px;
transform-origin: left top;
}
div span{
display: block;
position: absolute;
background-color: green;
}
div span:nth-child(1){
top: -1px;
left: -300px;
width: 0px;
height: 1px;
}
div span:nth-child(2){
top: -100px;
right: -1px;
width: 1px;
height: 0px;
}
div span:nth-child(3){
top: 51px;
right: -300px;
width: 0px;
height: 1px;
}
div span:nth-child(4){
top: 100px;
left: -1px;
width: 1px;
height: 0px;
}
div:hover{
color: green;
border: transparent solid 1px;
transition: all .1s linear;
animation: _div 1s ease-out 0s 1 alternate forwards; ;
}
div:hover span:nth-child(1){
width: 202px;
left: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(2){
height: 52px;
top: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(3){
width: 202px;
right: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(4){
height: 52px;
top: -1px;
transition: all .3s linear;
}
</style>
<body>
<div>
幽灵按钮
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
*{
margin: 0;
padding: 0;
}
body{
background-color: rgba(38,50,56,1);
}
html,body{
height: 100%;
}
div{
width: 200px;
height: 50px;
text-align: center;
line-height: 50px;
color: rgba(255,255,255,.1);
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%,50%);
border: rgba(255,255,255,.03) solid 1px;
cursor: pointer;
perspective: 500px;
transform-origin: left top;
}
div span{
display: block;
position: absolute;
background-color: green;
}
div span:nth-child(1){
top: -1px;
left: -300px;
width: 0px;
height: 1px;
}
div span:nth-child(2){
top: -100px;
right: -1px;
width: 1px;
height: 0px;
}
div span:nth-child(3){
top: 51px;
right: -300px;
width: 0px;
height: 1px;
}
div span:nth-child(4){
top: 100px;
left: -1px;
width: 1px;
height: 0px;
}
div:hover{
color: green;
border: transparent solid 1px;
transition: all .1s linear;
animation: _div 1s ease-out 0s 1 alternate forwards; ;
}
div:hover span:nth-child(1){
width: 202px;
left: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(2){
height: 52px;
top: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(3){
width: 202px;
right: -1px;
transition: all .3s linear;
}
div:hover span:nth-child(4){
height: 52px;
top: -1px;
transition: all .3s linear;
}
</style>
<body>
<div>
幽灵按钮
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</body>
</html>
相关文章推荐
- css伪类实现矩形按钮的右边缘中间有一个往里凹陷的小半圆
- css input[type=file] 样式美化,input上传按钮美化
- CSS制作三角形和按钮
- 纯CSS搞定按钮、链接点击时的虚线
- css去掉iPhone、iPad默认按钮样式
- 用CSS实现的几个非常漂亮的按钮
- CSS3案例学习---幽灵按钮
- 幽灵按钮
- 刚刚用CSS写了一个按钮,感觉不错,拿出来显摆一下...
- CSS自适应宽度圆角按钮
- 使用jquery 和 css 实现互斥按钮状态切换
- CSS如何让一个按钮居中应该怎么做
- css 按钮边框变圆角
- 简洁风格按钮及其CSS 3实现方法
- Css 单图片按钮实例(css 图片变换)
- CSS按钮样式大全(经典)
- 给datagrid的按钮列添加css
- 无图片的CSS按钮代码
- CSS实现圆角六色渐变自适应按钮
- CSS实例:创建一个鼠标感应换图片的按钮