Trying to use CSS animation for the first time. This is just a simple HTML page with a story. I just wanted to add a simple dripping animation over the page, which I have working nicely, but for some reason the animation code is interfering with my scrollbar code. So, when I try to open the page in chrome, there’s no scrollbar and no way to scroll down the page. There is only meant to be a vertical scrollbar. Where is the problem? Is there an inherent problem with having animation on a scrolling page?
Here’s my code, the CSS:
body{
margin: 0;
padding: 0;
overflow: hidden;
}
section{
position: absolute;
width: 100%;
height: 100vh;
background: url(redgothpeg.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.blooddrops{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.blooddrops div{
position: absolute;
display: block;
filter: brightness(40%);
}
.blooddrops div:nth-child(1){
left: 2%;
animation: animate 1s linear infinite;
animation-delay: -5s;
}
.blooddrops div:nth-child(2){
left: 5%;
animation: animate 1.2s linear infinite;
animation-delay: -3s;
}
.blooddrops div:nth-child(3){
left: 21%;
animation: animate 1.4s linear infinite;
animation-delay: -2s;
}
.blooddrops div:nth-child(4){
left: 13%;
animation: animate 1.6s linear infinite;
animation-delay: -1s;
}
.blooddrops div:nth-child(5){
left: 45%;
animation: animate 1.7s linear infinite;
animation-delay: -3s;
}
.blooddrops div:nth-child(6){
left: 92%;
animation: animate 1.9s linear infinite;
animation-delay: -4s;
}
.blooddrops div:nth-child(7){
left: 9%;
animation: animate 1.3s linear infinite;
animation-delay: -2s;
}
.blooddrops div:nth-child(8){
left: 19%;
animation: animate 1.2s linear infinite;
animation-delay: -5s;
}
.blooddrops div:nth-child(9){
left: 29%;
animation: animate 1.4s linear infinite;
/* animation-delay: -1s; */
}
.blooddrops div:nth-child(10){
left: 39%;
animation: animate 1.6s linear infinite;
/* animation-delay: -3s; */
}
.blooddrops div:nth-child(11){
left: 49%;
animation: animate 1.4s linear infinite;
animation-delay: -2s;
}
.blooddrops div:nth-child(12){
left: 52%;
animation: animate 1.7s linear infinite;
/* animation-delay: -2s; */
}
.blooddrops div:nth-child(13){
left: 69%;
animation: animate 1.5s linear infinite;
animation-delay: -3s;
}
.blooddrops div:nth-child(14){
left: 79%;
animation: animate 1.8s linear infinite;
/* animation-delay: -4s; */
}
.blooddrops div:nth-child(15){
left: 89%;
animation: animate 1.1s linear infinite;
animation-delay: -1s;
}
.blooddrops div:nth-child(16){
left: 72%;
animation: animate 1.3s linear infinite;
/* animation-delay: -4s; */
}
.blooddrops div:nth-child(17){
left: 82%;
animation: animate 1s linear infinite;
/* animation-delay: -2s; */
}
.blooddrops div:nth-child(18){
left: 62%;
animation: animate 1.6s linear infinite;
animation-delay: -4s;
}
@keyframes animate{
0%{
top: -10%;
}
100%{
top: 110%;
}
.set2:
transform: scale(2.5);
filter: blur(3px);
filter: brightness(40$);
}
The HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" Href="bloody.css">
<link rel="stylesheet" href="/webfont/stylesheet.css" type="text/css" charset="utf-8" />
<style>
:root{
scrollbar-color: #ac5dfb #3c3c3c;
scrollbar-width: thin;
}
body {
background-color: #FFFF;
background-position:center;
/* background-image:url(gothicpegHDghost.jpg); */
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
/*overflow:scroll;*/
}
body p {
color: #FFF;
}
::-webkit-scrollbar {
width: 6px;
height: 60px;
background-color: #3C3C3C;
opacity: 0.25;
}
::-webkit-scrollbar-thumb {
background-color: #ac5dfb;
border-radius: 8px;
opacity: 0.5;
}
body p {
font-family: Bradley Hand ITC;
}
body p {
/*color: #ac5dfb;*/
color: #9c5dfb;
text-shadow: 2px 2px 4px #000000;
/*text-shadow: 2px 4px 8px #306;*/
-webkit-text-stroke: 0.5px #9a53e1;
}
}
</style>