【开发小技巧】027—用HTML与CSS如何创建悬停折角纸叠效果?

web前端开发公众号,网站:www.webqdkf.com
web前端开发公众号
web前端开发公众号,网站:www.webqdkf.com
web前端开发公众号,网站:www.webqdkf.com
<style>
h1 {
color: #19b0cb;
}
.Fold {
position: absolute;
left: 50%;
top: 55%;
transform: translate(-50%, -50%);
width: 400px;
height: 200px;
background-color: #19b0cb;
}
h3 {
margin: 20px;
padding: 20px;
color: #fff;
}
.Fold:after {
position: absolute;
content: '';
right: 0;
top: 0;
}
.Fold:hover:after {
transition-duration: 1s;
border-bottom: 50px solid black;
border-right: 50px solid white;
}
style>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>
web前端开发公众号,网站:www.webqdkf.com
title>
<style>
h1 {
color: #19b0cb;
}
.Fold {
position: absolute;
left: 50%;
top: 55%;
transform: translate(-50%, -50%);
width: 400px;
height: 200px;
background-color: #19b0cb;
}
h3 {
margin: 20px;
padding: 20px;
color: #fff;
}
.Fold:after {
position: absolute;
content: '';
right: 0;
top: 0;
}
.Fold:hover:after {
transition-duration: 1s;
border-bottom: 50px solid black;
border-right: 50px solid white;
}
style>
head>
<body>
<center>
<h1>
web前端开发公众号
h1>
<b>
web前端开发公众号,网站:<a href="http://www.webqdkf.com">www.webqdkf.coma>
b>
<div class="Fold">
<h3>
web前端开发公众号,网站:www.webqdkf.comh3>
div>
center>
body>
html>


评论