1
How do I touch the header to the top of the div, and when the div is scrolled in auto, it doesn’t fix the header when scrolling down? Because when I put the header position in center, it is positioned right, but does not touch the top of the div: Follow the code.
<!DOCTYPE html>
<html>
<head>
<style>
#titulo {
background-color: mediumorchid;
position: center;
}
div {
top: inherit;
width: 300px;
height: 300px;
border: 1px solid;
overflow: auto;
display: inline-block;
margin-left: 5px;
margin-top: 5px;
}
}
</style>
</head>
<body>
<div>
<header id="titulo"><h1>titulo</h1></header>
<span></span>
</div>
</body>
</html>