how to center things in html pafe code example
Example 1: center with css
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Example 2: center p html
<p style="text-align: center">this is centered</p>
Example 3: centering in html
<style>
element
{
text-align: center;
}
</style>
-------------------------------------------------------------------------------
style.css
element
{
text-align: center;
}