这是程序员表白系列中的100款网站表白之一,旨在让任何人都能使用并创建自己的表白网站给心爱的人看。 此波共有100个表白网站,可以任意修改和使用,很多人会希望向心爱的男孩女孩告白,生性腼腆的人即使那个TA站在眼前都不敢向前表白。说不出口的话就用短视频告诉TA吧~制作一个表白网页告诉TA你的心意,演示如下。
文章目录
一、网页介绍一、网页效果二、代码展示1.HTML代码2.CSS代码三、精彩专栏一、网页介绍
1 网页简介:基于HTML+CSS+JavaScript 制作七夕情人节表白网页、生日祝福、七夕告白、 求婚、浪漫爱情3D相册、炫酷代码
,快来制作一款高端的表白网页送(他/她)浪漫的告白,制作修改简单,可自行更换背景音乐,文字和图片即可使用
2.网页编辑:任意HTML编辑软件(如:Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad++等任意html编辑软件进行运行及修改编辑等操作)。
一、网页效果
二、代码展示
1.HTML代码
代码如下(示例):以下仅展示部分代码供参考~
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>❤</title><link rel="stylesheet" href="css/index.css"></head><body><div class="textCon"><div class="words">我的小花花,今天是认识你的第</div><div class="days"><span class="days-number">1921</span><span class="days-label">天</span></div><div class="seconds">15 hours 24 minutes 30 seconds</div></div><div class="heart"></div><script src="js/index.js"></script><script src="js/love.js"></script></body></html>
2.CSS代码
*{margin: 0;padding:0;}html,body{width:100%;height:100%;/*text-align: center;*/background-color: #ffc5b3;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);background-image: radial-gradient(#ffeded, #ffc7c7);}.textCon{-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;width:700px;height:60px;margin:50px auto;}.text{font-size:48px;}.heart{width:80px;height:80px;background-color:#cc2a5d;margin:200px auto;position: relative;transform: rotate(45deg);animation: heart 1s ease-in infinite;}.heart::before,.heart::after{content:'';width:100%;height:100%;background-color:#cc2a5d;border-radius: 50%;}.heart::before{position: absolute;top:0;left:0;transform: translateX(-50%);}.heart::after{position: absolute;top:0;left:0;transform: translateY(-50%);}@keyframes heart{0%{transform: scale(0.8) rotate(45deg);opacity: 0.8;}50%{transform: scale(1) rotate(45deg);opacity: 1;}100%{transform: scale(0.8) rotate(45deg);opacity: 0.8;}}.textCon .item{position: absolute;opacity: 0;background-color:#cc2a5d;transform: rotate(45deg);animation: hearts 3s ease-in infinite;}.textCon .item::before,.textCon .item::after{content:'';width:100%;height:100%;background-color:#cc2a5d;position: absolute;top:0;left:0;border-radius: 50%;}.textCon .item::before{transform: translateX(-50%);}.textCon .item::after{transform: translateY(-50%);}@keyframes hearts{0%{opacity: 0;transform: translateY(0%) rotate(45deg);}20%{opacity: 0.8;transform: translateY(-20%) rotate(45deg);}100%{opacity: 0;transform: translateY(-1000%) rotate(45deg);}}.days-label {font-size: 30px;}.seconds {margin-top: 10px;font-size: 32px;font-family: "Monda_bo", Georgia, sans-serif;width: auto;text-align: center;}.seconds-label {margin-top: 32px;font-size: 32px;font-family: "Monda_no", Georgia, sans-serif;width: auto;text-align: center;}.container {position: absolute;}.days {font-size: 40px;width: auto;text-align: center;}.words {font-size: 50px;font-family: 'Regular', cursive;width: auto;text-align: center;}
三、精彩专栏
看到这里了就 【点赞,关注,收藏】 三连 支持下吧,你的支持是我创作的动力。