Z
Z
ZMaxonchik2019-08-20 12:37:47
css
ZMaxonchik, 2019-08-20 12:37:47

How to competently implement 1 landing screen in the entire height of the browser?

Hello!
Given:

<div class="box">
      <p class="title">ТЕКСТ</p>
      <p class="info">ТЕКСТ2</p>
      <div class="button">
        <a href="">КНОПКА</a>
      </div>
    </div>

.box {
                 padding-top: 20vh;
                 height: 100vh;
        }
       .button {
           margin: 12vh auto 0;
       }

Question: How to properly adapt?
Made through media requests for width, then noticed that the button often climbs beyond 1 screen.
So far I see a solution through media queries by height.
Maybe there is a more beautiful solution so that the button fits into 1 screen?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
organica, 2019-08-20
@organica

I'm not an expert, but bootstrap will definitely help :)

A
Anatoly Kulikov, 2019-08-20
@anatoly_kulikov

Make the .box flex, wrap the insides in another container and center it. Somewhere like this:

.box {
    display: flex;
    width: 100%;
    height: 100vh;
}
.box__inner_wrap {
    display:  block;
    width: 100%;  // или какая нужна
    margin: auto;
}

For other elements, you already adjust the sizes, indents, and so on. Use media queries to fit the screen sizes you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question