I'm trying to get a div to expand from the top of the page to the bottom. When the animation starts the div will be hidden (height 0%), till it fills the page at 100%. I tried to do it like so, but none of it seems to be working:
HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>About Me</title>
<link rel="stylesheet" href="stylesheets/main.css">
</head>
<body>
<div id="bar"></div>
</body>
</html>
CSS:
*
{
box-sizing: border-box;
}
body
{
height: auto;
width: auto;
direction: ltr;
z-index: 1;
background-color: #fff;
}
#bar
{
position: relative;
top: 0px;
left: 0px;
width: 5%;
background-color: #3b5598;
display: block;
-webkit-animation: bar 7s ease;
}
@keyframes bar
{
0% {
top: 0%;
}
100% {
top: 100%;;
}
}
I've had animations working before from left to right, but nothing coming from the top to bottom. I've extensively google'd this but to no avail. Thanks