生成漂亮的CSS确认框按钮悬浮效果

生成漂亮的CSS确认框按钮悬浮效果

html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./test.css">
</head>

<body>
<div id="holder">

<h2>buttotn</h2>
<p class="desc">请将鼠标悬浮于橙色按钮</p>

<div class="button">
    <p class="btnText">确认</p>
    <div class="btnTwo">
      <p class="btnText2"> <i class="fa fa-check"></i> </p>
    </div>
 </div>

<div class="button">
    <p class="btnText">取消</p>
    <div class="btnTwo">
      <p class="btnText2"> <i class="fa fa-times"></i> </p>
    </div>
 </div>

</div>
</body>

<script type="text/javascript" src="http://cdn.gbtags.com/jquery/1.11.1/jquery.min.js"></script>
</html>

css:

/*CSS源代码*/
@import url("http://cdn.gbtags.com/font-awesome/4.1.0/css/font-awesome.min.css");

body{
    background:#CFCFCF;
    font-family: 'microsoft yahei',Arial,sans-serif;
}

h2{
  font-weight: normal;
  font-size:18px;
  text-align:center;
}

.desc{
  text-align:center;
  font-size:12px;
  color: #AFAFAF;
}

#holder{
  background: white;
  padding: 10px;
  width: 250px;
  margin: 60px auto;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.2);
}
.button {
  background: orange;
  margin : 20px auto;
  width : 200px;
  height : 50px;
  overflow: hidden;
  text-align : center;
  transition : .2s;
  cursor : pointer;
  box-shadow: 0px 1px 2px rgba(0,0,0,.2);
}
.btnTwo {
  position : relative;
  width : 200px;
  height : 100px;
  margin-top: -100px;
  padding-top: 2px;
  background : #26A69A;
  left : -250px;
  transition : .3s;
}
.btnText {
  color : white;
  transition : .3s;
}
.btnText2 {
  margin-top : 63px;
  margin-right : -130px;
  color : #FFF;
}
.button:hover .btnTwo{ 
  left: -130px;
}
.button:hover .btnText{ 
  margin-left : 65px;
}
.button:active { 
  box-shadow: 0px 5px 5px rgba(0,0,0,0.4);
}

这里写图片描述

来自这里

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值