Помогите с блоком
Не пойму как написать этот блок, точнее какую структуру задать
Мне понятно как сделать такую десктопную версию
Но как на адаптиве сохранить изображения по краям и контейнер в тексте, при этом чтобы ничего не ломалось я не пойму
Ответы (1 шт):
Автор решения: Проста Miha
→ Ссылка
Это просто пример как можно сделать)
* {
box-sizing: border-box;
}
body {
width: 100%;
font-family: monospace;
margin: 0;
display: flex;
justify-content: center;
align-items: centerl flex-wrap: wrap;
}
.info-block {
width: min(1080px, 100%);
display: flex;
flex-wrap: wrap;
}
.info-row {
width: 100%;
display: flex;
}
.info-cell {
width: 50%;
min-height: 240px;
}
.cell-text {
padding: 32px;
display: flex;
flex-direction: column;
justify-content: center;
}
.cell-text:nth-child(1) {
background-color: #000;
color: #fff;
}
.cell-img {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.img-1 {
background-image: url('https://cdn3.vectorstock.com/i/1000x1000/30/02/person-programmer-working-on-pc-laptop-vector-19533002.jpg');
}
.img-2 {
background-image: url('https://img.etimg.com/thumb/msid-75289441,width-640,resizemode-4,imgsize-979296/spring-clean-your-pc.jpg');
}
@media only screen and (max-width: 720px) {
.info-row {
flex-direction: column;
}
.info-cell {
width: 100%;
}
.info-row:nth-child(1) {
flex-direction: column-reverse;
}
}
<div class="info-block">
<div class="info-row">
<div class="info-cell cell-text">
<h3>Lorem ipsim</h3>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum
</div>
<div class="info-cell cell-img img-1">
</div>
</div>
<div class="info-row">
<div class="info-cell cell-img img-2">
<img src="">
</div>
<div class="info-cell cell-text">
<h3>Lorem ipsim</h3>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum
</div>
</div>
</div>