O
O
Oleg Sevoc2020-04-25 16:51:27
css
Oleg Sevoc, 2020-04-25 16:51:27

How to align text?

Good day to all, tell me how to make the text pressed not to the edge but to be in one line?
like this in the center of the block
5ea4405a5079f572009996.jpeg

5ea43fd8749a8301754374.jpeg

<div class="box_sub">
        <div class="box">
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum .</div>
            <div>Lorem i dolor sit.</div>
            <div>Lorem ipsumr sit.</div>
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
        </div>
        <div class="box">
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum sit.</div>
            <div>Lorem dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
        </div>
        <div class="box">
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem dolor sit.</div>
            <div>Lorem dolor sit.</div>
            <div>Lorem dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
            <div>Lorem ipsum dolor sit.</div>
        </div>
    </div>


.box {
    width: 400px;
    height: 400px;
    border: 2px solid green;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    margin: 20px;
}

.box_sub {
    display: flex;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-04-25
Matytsyn @ArsenyMatytsyn

Use padding and don't bother centering.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question