S
S
Sl1n2021-01-29 15:54:42
Layout
Sl1n, 2021-01-29 15:54:42

Can't move div with flex. How????

In short, below is the code. The bottom line is that I wanted to move the div, and flex does not work. I don't want to do it through transform. For some reason, you can't remove the
HTML margin from a div

<div class="info_about_us">
        <h2 class="title_about_us">
          ABOUT US
        </h2>
        <p class="text_about_us">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Optio hic, consequuntur et quaerat! Asperiores hic molestias enim pariatur neque cupiditate, maxime, nihil. Accusamus, ratione placeat harum impedit, dolorum repudiandae perferendis.
          A, atque tenetur reiciendis quod eveniet fuga omnis, recusandae ullam eius id rem, unde. Ipsum, vero, similique. Eum repellat, reprehenderit adipisci quis, rerum architecto, nulla necessitatibus ullam distinctio nesciunt itaque.
        </p>

        <form action="" class="read_more">
          <input type="button" class="button_read_more">
        </form>
      </div>


css
.info_about_us {
  display: flex;
  justify-content: end;
  width: 500px;
  margin: 0;
}

.title_about_us {
  margin: 0;
}

.text_about_us {
  margin: 0;
}

.read_more {
  margin: 0;
}

.button_resd_more {
  margin: 0;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Varlakov, 2021-01-29
@Sl1n

You probably wanted to align the content to the right?
If yes, then justify-content: flex-end;
remove margin and padding
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
because margin works great for you:
https://jsfiddle.net/khgb2pw0/14/

V
Vladislav Lyskov, 2021-01-29
@Vlatqa

justify-content: flex-end;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question