I want to my text to be centered both horizontally and vertically within a div.
I'm using the inset property to fill up the entire div with my p tag.
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div class="wrapper">
<div class="zone">
<p>Hello World</p>
</div>
</div>
</body>
</html>
CSS:
* {
margin: 0;
padding: 0;
box-sizing: bordered-box;
}
.wrapper {
background: red;
}
.zone {
min-height:10em;
text-align: center;
position: relative;
}
.zone p {
position: absolute;
inset:0;
}
However I don't get it to work. Can anyone give me a hint on how to achive this with the inset property?