Как сделать контейнер имел max-width таким, чтобы левая часть была с отступом, а правая шла через весь экран
Нужно, чтобы грузовик касался правой части экрана, но при этом, чтобы левая часть с текстом имела такой же отступ как и у header а, нужно сделать это без позиционирования грузовика, контейнер имеет max-width:1270px
Ответы (1 шт):
Автор решения: Евгений Ли
→ Ссылка
Надеюсь в цветах блоков разберётесь и ширину я уменьшил, что бы здесь отображалось корректно.
body {
margin: 0;
}
div {
display: block;
}
.wrapper {
background-color: gray;
display: grid;
}
.container {
background-color: green;
max-width: 500px;
width: 500px;
margin: 0 auto;
grid-row-start: 1;
grid-column-start: 1;
}
.info {
width: 50%;
height: 200px;
background-color: red;
}
.image {
width: 100%;
grid-row-start: 1;
grid-column-start: 1;
display: flex;
justify-content: flex-end;
}
.image-region {
background-color: yellow;
display: flex;
justify-content: flex-end;
align-items: center;
width: 50%;
height: 100%;
}
img {
display: block;
width: 200px;
height: 150px;
background-color: white;
}
<div class="wrapper">
<div class="container">
<div class="info">
</div>
</div>
<div class="image">
<div class="image-region">
<img src="" alt="">
</div>
</div>
</div>
