马上就要情人节了,这段时间我会陆续出一些表白代码,绝对实用!
核心代码:
<!DOCTYPE html>
<html lang="en">
<head 'content-type' : 'application/x-www-form-urlencoded'>
<meta charset="UTF-8">
<title>我爱你</title>
<style type="text/css">
*{
margin: 0px;
border: 0px;
}
body{
overflow: hidden;
background-color: #000000;
}
@keyframes rotate{
from{
transform:rotateX(0deg) rotateY(0deg);
}
to{
transform: rotateX(360deg) rotateY(360deg);
}
}
.square{
position: relative;
width: 100px;
height: 100px;
transform:translateX(50px) translateY(300px) translateZ(50px);
transform-style: preserve-3d;
}
.square div{
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
}
.square div:nth-child(1){
top: 100px;
transform-origin: top;
transform:rotateX(-90deg);
}
.square div:nth-child(2){
left: 100px;
transform-origin: left;
transform:rotateY(90deg);
}
.square div:nth-child(3){
left: -100px;
transform-origin: right;
transform:rotateY(-90deg);
}
.square div:nth-child(4){
top: -100px;
transform-origin: bottom;
transform:rotateX(90deg);
}
.square div:nth-child(6){
top:0;
transform:translateZ(-100px);
}
.square div:nth-child(5){
}
.heart{
position: absolute;
top:0;
left:0;
height: 260px;
width: 200px;
border: 2px solid red;
margin: 200px auto;
border-radius: 50% 50% 0%/50% 50% 0%;
border-bottom: 0;
border-left: 0;
}
img{
width: 100px;
height:100px;
}
</style>
</head>
<body>
<div class="container">
<div class="square">
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=d3504467c477c4e01a6f0260cb98190e&imgtype=0&src=http%3A%2F%2Fpan.iqiyi.com%2Fext%2Fpaopao%2F%3Ftoken%3DeJxjYGBgmM78W4UBDMS2AAATNwKE.jpg"></div>
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=e775cea9b00cb11b6896c4da10add95e&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F7e2797aa748ecdac67ffe1f1d3beddbe623a363743d10-gz1KTO_fw658"></div>
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=79097818e33bb2b7cf01d4911db7be02&imgtype=0&src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201909%2F26%2F20190926135456_L4NeB.thumb.400_0.jpeg"></div>
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=1f5ee0885c6b3b5568240a581256abe6&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201806%2F24%2F20180624082734_otodl.jpg"></div>
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=5e4f0bb44403c4980e8f914d234edfdd&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F7834060435%2F1000.jpg"></div>
<div><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608466964941&di=86ccf8b49b111bbf178b95d054ac8f72&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201811%2F20%2F20181120104318_rtrct.jpg"></div>
</div>
</div>
</body>
</html>
代码补充: 上述只是核心代码,并不是全部代码。
整个项目在我的资源里面:
情人节表白代码(1)
这个资源是免费的,只要关注博主即可免费领取,里面有使用说明。
效果:
照片,表白话语和音乐都可以改。