html页面飘玫瑰,HTML5 CSS3一款很漂亮的玫瑰红用户订阅界面模板

CSS

语言:

CSSSCSS

确定

/* fonts */

@import url('https://fonts.googleapis.com/css?family=Abel|Aguafina+Script|Artifika|Athiti|Condiment|Dosis|Droid+Serif|Farsan|Gurajada|Josefin+Sans|Lato|Lora|Merriweather|Noto+Serif|Open+Sans+Condensed:300|Playfair+Display|Rasa|Sahitya|Share+Tech|Text+Me+One|Titillium+Web');

body {

/* background-image: linear-gradient(to top, #cd9cf2 0%, #f6f3ff 100%); */

background: url(/uploads/1706/nature-flowers-vintage-plant.jpg);

background-attachment: fixed;

background-size: cover;

margin: 0;

}

#container {

background-image: linear-gradient(to top, rgba(205, 156, 242, 0.40) 0%, rgba(246, 255, 255, 0.71) 100%);

box-shadow: 0 15px 30px 1px rgba(128, 128, 128, 0.31);

text-align: center;

border-radius: 5px;

margin: 3em auto;

background: rgba(255, 255, 255, 0.95);

height: 300px;

width: 480px;

padding: 1em;

position: fixed;

bottom: 0;

right: 0;

left: 0;

top: 0;

}

#container h2 {

background: url(/uploads/1706/nature-flowers-vintage-plant.jpg);

-webkit-text-fill-color: transparent;

-webkit-background-clip: text;

/* background-image: linear-gradient(to top, #cd9cf2 0%, #f6f3ff 100%); */

font-family: 'Playfair Display', serif;

background-repeat: no-repeat;

background-attachment: fixed;

background-size: cover;

letter-spacing: 2px;

font-size: 3.5em;

margin: 0;

}

#container p {

font-family: 'Farsan', cursive;

margin: 3px 0 1.5em 0;

font-size: 1.3em;

color: #7d7d7d;

}

#container input {

/* background: rgba(255, 13, 254, 0.90); */

width: 210px;

display: inline-block;

text-align: center;

border-radius: 7px;

background: #eee;

padding: 1em 2em;

outline: none;

border: none;

color: #222;

transition: 0.3s linear;

}

::placeholder {

color: #999;

}

#container input:focus {

background: rgba(0, 0, 333, 0.10);

}

#container button {

background-image: linear-gradient(to left, rgba(255, 146, 202, 0.75) 0%, rgba(145, 149, 251, 0.86) 100%);

box-shadow: 0 9px 25px -5px #df91fb;

font-family: 'Abel', sans-serif;

padding: 0.5em 1.9em;

margin: 2.3em 0 0 0;

border-radius: 7px;

font-size: 1.4em;

cursor: pointer;

color: #FFFFFF;

font-size: 1em;

outline: none;

border: none;

transition: 0.3s linear;

}

#container button:hover {

transform: translatey(2px);

}

#container button:active {

transform: translatey(5px);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现html玫瑰飘落代码,首先需要了解CSS的动画效果和JavaScript的循环语句。 1. 在CSS中,使用@keyframes定义一个动画,来实现玫瑰花瓣飘落的效果。 ``` @keyframes falling { from { transform: translateY(0%); } to { transform: translateY(1000%); } } ``` 在上面的代码中,定义了一个`falling`动画,从它的起始点(`from`)到终止点(`to`)的过程中,沿y轴平移了1000%的距离。 2. 在JavaScript中,使用`setInterval`方法来生成玫瑰花瓣的数量和位置,并加入动画效果。 ``` setInterval(function(){ var rose = document.createElement("div"); rose.className = "rose"; rose.style.left = Math.random() * 100 + "%"; document.body.appendChild(rose); setTimeout(function(){ rose.remove(); }, 5000); }, 100); ``` 在上面的代码中,定义了一个循环,每隔100毫秒钟就会新建一个`div`元素,并设置它的类名为`rose`。然后,随机设置它的左边距(`left`)值,以便让玫瑰花瓣在屏幕上飘落。最后,使用`setTimeout`方法来控制花瓣5秒钟后消失。 3. 最后,在CSS中定义玫瑰花瓣的样式。 ``` .rose { position: fixed; top: -10px; width: 10px; height: 10px; border-radius: 50%; background-color: #5baddc; animation: falling 10s ease-in-out infinite; } ``` 在上面的代码中,定义了玫瑰花瓣的样式,包括:固定定位、大小、边框圆角、背景颜色和动画效果。使用`infinite`属性来让动画无限循环播放。 综上所述,html玫瑰飘落代码的实现需要结合CSS动画效果和JavaScript循环语句,通过生成元素和设置动画样式来实现蓝玫瑰花瓣在屏幕上飘落的效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值