WEB前端

css3 鼠标经过div放大浮起特效效果

位置:首页 > WEB前端 > css3教程,2019-08-08 15:34
今天做了个css3 鼠标经过div放大浮起特效效果。在前端开发中也常常用到这样的代码。

css3 鼠标经过div放大效果

css3 鼠标经过div放大(图0)

css3 鼠标经过div放大代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>css3 鼠标经过div放大浮起特效效果 </title>
<style type="text/css">
* {
  margin: 0px;
  padding: 0px;
  box-sizing:border-box;
}
ul {
  list-style: none;
 
}
.clear{clear:both;}
#adv {
  padding-bottom: 20px;
  padding-top:20px;
  background: #f5f5f5;
  height: 360px;
  z-index: 2;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  display: block;
}

#adv ul {
width:1200px;margin:auto;
  height: 100%;
  position: relative;
  background: #fff;
  -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
          box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}


#adv li {
  float: left;
  width: 25%;
  text-align: center;
  padding-top: 50px;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  height: 100%;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  background: #fff;
  position: relative;
}

#adv li:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: currentcolor;
  height: 60%;
  margin: auto;
  display: block;
  opacity: .1;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

#adv li:hover {
  -webkit-box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);
          box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
  z-index: 3;
}

#adv li:hover::before {
  opacity: 0;
}
   </style>

</head>
<body>

<section id="adv">
    <ul>
        <li>

        </li>
        <li>
      
        </li>
        <li>
          
        </li>
        <li>
          
        </li>
		<div class="clear"></div>
    </ul>
</section>
</body>
</html>
css3 鼠标经过div放大浮起特效效果,是不是很简单。

TAGS:css3 鼠标经过div放大

猜你喜欢

NewHot