M
M
MRcracker2021-06-26 12:08:34
css
MRcracker, 2021-06-26 12:08:34

How to set the container correctly?

Good afternoon.

I create a common container for the site inside which the content will be located. The container should be 1200px wide. Side padding 15px.

If I set width: 1200px, then in this case the container becomes a rigidly fixed size, and if I set max-width: 1200px, then the container, as far as I understand, is stretched depending on the content, but in this case it becomes less than 120px.

Tell me how to properly style the container so that it is rubber, but in the case when the content is less than 1200px in width in the block, it still takes a size of 1200px

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2021-06-26
@MRcracker

Unclear.
If it cannot be less than 1200 then set min-width:1200px

K
kryamk, 2021-06-26
@kryamk

width: 1200px;
max-width: 100%
padding: 015px;
margin: 0 auto;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question