Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<title> Ensure top takes effect after element is centered </title>
<style>
div {
inset: 0;
background-color: black;
margin: auto;
top: 10px;
position: absolute;
block-size: 200px;
inline-size: 100px;
border: 5px solid red;
}
</style>
<div></div>