css紙飛機效果程式碼例項

admin發表於2017-04-14

分享一段程式碼例項,它利用css實現了紙飛機效果。

程式碼例項如下:

[HTML] 純文字檢視 複製程式碼
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>螞蟻部落</title>
<style type="text/css">
div {
  margin: 40px;
  float: left;
}
.plan {
  position: relative;
  border-top: 100px solid transparent;
  border-bottom: 40px solid transparent;
  border-left: 30px solid cadetblue;
  transform: rotate(70deg);
}
.plan:before, .plan:after {
  content: '';
  display: block;
  position: absolute;
  border-top: 100px solid transparent;
  border-left: 40px solid cadetblue;
  border-right: 80px solid transparent;
  top: -121px;
  left: -16px;
  transform: rotate(-20deg);
}
.plan:after {
  border-top: 20px solid cadetblue;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  top: -4px;
  left: 1px;
  transform: rotate(-40deg);
}
</style>
</head>
<body>
  <div class="plan"></div>
</body>
</html>

相關文章