Good day! I'm studying on how to align text vertically at center. I'm trying to know why is the transform:translateY(50%) moves just a bit and transform:translateX(50%) moves quite a lot.
I've tried moving my element using an exact px value and I somehow get it on how it works but using percentage like this transform:translateY(-50%), I'm confused.
<head>
<style type="text/css">
.Container {
background-color: #85C1E9;
height: 200px;
width: 200px;
}
.Content {
position: relative;
transform: translateY(50%);
transform: translateY(50%);
}
</style>
</head>
<body>
<div class="Container">
<div class="Content">
<p>Hello</p>
</div>
</div>
</body>
I just want to know why if I use translateX(50%), the element moves a lot farther and when it's translateY(50%) it does move, but just a little.