0
I have the body and a div with width: 320px
;
I would like to focus on body that is flex.
But look at that, NAY I want to center your content.
Would like to centralize the very div in body.
body {
display: flex;
}
div#tudo {
display: flex;
width: 320px;
}
<body>
<div id=tudo>
<label>teste</label>
</div>
</body>
Use margin: 0 auto
or has some recourse flexbox for that reason?
What I seek is a property that makes similar to the result of align-self: center
. However, in the horizontal.
Have you tried using the
margin
that quotes? What was the result? And if you do not want to use flex, it did not make much sense to ask as it does in flex. By the way, this should have several duplicates on the site. Even researched?– Woss
Center horizontally or vertically?
– hugocsl
Hello Antonio. Good morning! So with margim it works But I want to start using the flex. I was not very happy in my placement. What I’m really looking for is something similar to align-self but for horizontal. I don’t think there’s any?
– Carlos Rocha
There is a BIG difference in an element that is a flex container, and the element that is the child of a flex container. I strongly suggest that you read this guide in Portuguese about flex https://origamid.com/projects/flexbox-fullguide/ is half an hour that you will stop to study and will better understand what I said and because your question is duplicated. After reading the guide read the duplicate link, it will help you ;)
– hugocsl
Well, I added information to the question. If you can read it... I appreciate it! But I will read your references!
– Carlos Rocha
Related or new duplicate: https://answall.com/questions/355954/no-flexbox-por-que-o-justify-self-n%C3%a3o-works in-children of a parent-with-display
– Woss