Let's suppose I'm going to position a div
co_de 100px
and height
, (a square) so I place this square in width
and margin-left 40%
, square is more or less centralized, right? Now I'll put a text written "hi" inside it with the tag margin-top 20%
, now if I use the magnifying glass, the following happens, only the right side and bottom of the square will expand while its other two sides do not expand and the text remains intact, let's say I want everything to expand without the sides moving like this?
About the code I mentioned above:
.caracteristicas{
position: absolute;
background-color: green;
height: 100px;
width: 100px;
margin-left: 40%;
margin-top: 20%;
}
<html>
<head>
<title>Aprendendo a centralizar</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="caracteristicas">
<p>oi</p>
</div>
</body>
</html>