css实现一个点击弹出层效果代码

代码语言:html

所属分类:弹出层

代码描述:css实现一个点击弹出层效果代码

代码标签: 点击 弹出 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
<style>
/* Fonts */
@import url(https://fonts.googleapis.com/css?family=Oswald);
/* Variables */
/* Styles */
body {
  font-family: "Oswald", sans-serif;
  background: #dbf2f7;
  margin: 0;
}
body h1 {
  font-weight: normal;
  text-transform: uppercase;
  margin: 0;
  color: #565656;
}
body h2 {
  font-size: 18px;
  font-weight: normal;
  margin: 0px 0px 50px 0px;
  color: #A9A9A9;
}
body .wrapper {
  background: white;
  width: 800px;
  padding: 50px 0px;
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
  position: relative;
  /* I don't like this, i will probably replace with a sass loop at some point */
}
body .wrapper label {
  width: 200px;
  height: 200px;
  background: #92b2cd;
  display: inline-block;
  border-radius: 2px;
  margin: 10px;
  cursor: pointer;
}
body .wrapper label span {
  color: white;
  font-size: 13px;
  position: relative;
  top: 10px;
}
body .wrapper label p {
  margin: 25px;
  color: white;
  display: none;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  width: 150px;
  margin: 0 auto;
  top: 25px;
  font-size: 10px;
}
body .wrapper label a {
  display: none;
  color: white;
  position: absolute;
  bottom: 10px;
  left: 0;
  font-size: 10px;
  right: 0;
  margin: 0 auto;
}
body .wrapper input[type=checkbox] {
  display: none;
}
body .wrapper input[type=checkbox]:checked + label a, body .wrapper input[type=checkbox]:checked + label p {
  display: block;
}
body .wrapper input[type=checkbox]:checked + label span, body .wrapper input[type=checkbox]:checked + label div {
  visibility: hidden;
}
body .wrapper input[type=checkbox]:checked + label {
  left: 0;
  transform: scale(3.33);
  z-index: 122221;
  transition-duration: 0.1s;
  position: relative;
  transition-property: transform;
  top: 0;
  background: #5d85a1;
}
body .wrapper input[type=checkbox]:not(:checked) + label {
  transform: scale(1);
  transition-duration: 0.1s;
  transition-property: transform;
}
body .wrapper label:nth-of-type(1) {
  transform-origin: 0% 0%;
}
body .wrapper label:nth-of-type(2) {
  transform-origin: 50% 0%;
}
body .wrapper label:nth-of-type(3) {
  transform-origin: 100% 0%;
}
body .wrapper label:nth-of-type(4) {
  transform-origin: 0% 50%;
}
body .wrapper label:nth-of-type(5) {
  transform-origin: 50% 50%;
}
body .wrapper label:nth-of-type(6) {
  transform-origin: 100% 50%;
}
body .wrapper label:nth-of-type(7) {
  transform-origin: 0% 100%;
}
body .wrapper label:nth-of-type(8) {
  transform-origin: 50% 100%;
}
body .wrapper label:nth-of-type(9) {
  transform-origin: 100% 100%;
}
body .wrapper .circle {
  visibility: visible;
  width: 40px;
  height: 40px;
  border: 3px solid white;
  border-radius: 100%;
  opacity: 0.3;
  margin: 60px auto 0px auto;
  -webkit-animation: circle 1s infinite;
  /* Chrome, Safari, Opera */
  animation: circle 1s infinite;
}

/* Animations */
@-webkit-keyframes circle {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
</style>




</head>

<body >
  <div class='wrapper'>
  <h1>
    Oh, hey there
  </h1>
  <h2>
    Go ahead and click on the blocks to watch 'em pop
  </h2>
  <input id='.........完整代码请登录后点击上方下载按钮下载查看

网友评论0