[英]How can I get rainyday.js to use a CSS background image as it's background?
因此,我有一个基本网站,其中包含使用CSS设置的完整固定背景。 我想在整个网站的所有内容(包括文本)的顶部实现rainyday.js。
当前,我能做的最好的就是将rainyday.js覆盖在顶部的另一个背景图像,并在那小部分下雨。 它正在创建另一个“背景”,并使用它来代替。
在这里似乎有可能,但是我不明白您应该怎么做。
谢谢!
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>Safe House</title>
<link href="index.css" rel="stylesheet">
</head>
<body>
<div id="yes">
<div id="maindiv">
Safe House
</div>
<div id="secondarydiv">
<p>noun</p>
<p>1.</p>
<p>a dwelling or building whose conventional appearance makes it a
safe or</p>
<p>inconspicuous place for hiding, taking refuge, or carrying on
clandestine activities.</p>
</div>
</div>
</body>
</html>
CSS:
@import url(http://fonts.googleapis.com/css?family=Coming+Soon);
#maindiv {
text-align: center;
font-family: 'Coming Soon', sans-serif;
font-style: italic;
color: white;
text-transform: uppercase;
font-size: 10em;
font-weight: 700;
text-transform: uppercase;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
#secondarydiv{
font-family: 'Coming Soon', sans-serif;
font-style: italic;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
font-size: 1.5em; /*font size of main headings*/
font-weight: 700;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
margin-left: 300px;
}
#yes {
margin-top: 150px;
}
body {
background: url("images/bg.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
p {
margin: 0;
}
作者仍在努力之中,请参阅https://github.com/maroslaw/rainyday.js/issues/95 ,您可以在该问题单中与其他人讨论,甚至可以加入进度以添加此功能!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.