2
I have a <div>
with the property text-align: center;
so that the text is centralized, but I want the lines of the texts to always start on the left.
Below is an example of what I want:
<DIV>
-----------------------------
| |
| Olá pessoal |
| Este é um exemplo. |
| Do que eu quero. |
| |
-----------------------------
How can I do that? Is it possible? The code I’m using is this:
#myDiv {
text-align: center;
}
<div id="myDiv">
<!-- Alguns outros elementos... -->
<div id="info">
Dado 1: 334<br>Dado 2: 192.2<br>Dado 3: 3455.234
</div>
</div>
@Luizfelipe yes, I must point out that using flex for something as trivial as this is like hiring a hydraulic engineer to discharge your discharge for you. Flex and grid are things that have a number of characteristics, including affecting the parent element, which is another problem, you have to understand the behavior of the box-model (https://www.w3.org/TR/css-box-3/) which is something that if we lose can complicate quite a lot in a failure difficult to detect, should a failure occur.
– Guilherme Nascimento
I must agree. :-)
– Luiz Felipe