G
G
GandalfWhiteGO2022-03-13 17:12:47
css
GandalfWhiteGO, 2022-03-13 17:12:47

How to perfect such a design?

How to make such a design so that in the horizontal and vertical mode the div is always in the center, and the buttons change their position as in the picture.
622dfb2a5ce1b242400798.png

and is it possible to do this without media ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DanyGersh, 2022-03-13
@DanyGersh

Without Media,
HTML is possible:

<div class="container">
   <div class="div">Div</div>
   <div class="buttons">
      <button>Button1</button>
      <button>Button2</button>
   </div>
</div>

CSS:
.container{
   display: flex;
   align-items: center;
  justify-content: center:
}
.buttons{
   display: flex;
   justify-content: space-between;
   align-items: flex-end;
   position: absolute;
   top: 0;
   left: 0;
   bottom: 0;    /* не обязательно*/
   right: 0;    /* не обязательно*/
   height: 100vh;
   width: 100vw;

Like so

I
ivan448, 2022-03-14
@ivan448

Via flex and set order by media screen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question