<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 1200px;
height: 5000px;
overflow: hidden;
background-color: #ccc;
margin: 0 auto;
}
.top {
position: fixed;
width: 1200px;
height: 0;
background-color: red;
transition: height 1s;
}