Как сверстать блок картинка+текст справа от нее(на фото)
Bот кусок html кода — то блоки становятся в ряд, а не друг под другом, то всё исчезнет:
.content{
display: flex;
max-width: 1100px;
margin: 0 auto;
background-color: #edeef0;
font-size: 18px;
font-style: normal;
color: #333333;
line-height: 1.4em;
letter-spacing: 0em;
}
.content-wrap {
display: flex;
align-items: center;
}
.item {
}
.cont-text {
max-width: 500px;
margin-left: 40px;
margin-right: 10px;
}
.cont-text h2{
margin-bottom: 30px;
font-size: 23px;
font-weight: 400;
font-style: normal;
color: #333333;
line-height: 1.4em;
letter-spacing: 0em;
}
.price {
margin-top: 30px;
margin-bottom: 30px;
font-size: 24px;
font-weight: 300;
font-style: normal;
color: #333333;
line-height: 1.37em;
letter-spacing: 0em;
}
.delivery {
text-decoration:underline;
font-size: 16px;
}
<seciton class="content">
<div class="content-wrap">
<div class="item"><img src="img/icons/item1.jpg" alt="">
</div>
<div class="cont-text">
<h2>Кабель Lightning/ USB из комплекта iPhone</h2>
<p>Оригинальный кабель питания Lightning/ USB, который идет в комплекте с оригинальным iPhone.</p>
<p class="price">900р</p>
<a href="#" class="delivery">Купить с доставкой в Череповце</a>
</div>
</div>
</seciton>
Ответы (2 шт):
Автор решения: Sevastopol'
→ Ссылка
.content {
display: flex;
flex-direction: column;
flex-wrap: wrap;
max-width: 1100px;
margin: 0 auto;
background-color: #edeef0;
font-size: 18px;
font-style: normal;
color: #333333;
line-height: 1.4em;
letter-spacing: 0em;
}
.content-wrap {
display: flex;
align-items: center;
margin-bottom: 50px;
}
.item {}
.cont-text {
max-width: 500px;
margin-left: 40px;
margin-right: 10px;
}
.cont-text h2 {
margin-bottom: 30px;
font-size: 23px;
font-weight: 400;
font-style: normal;
color: #333333;
line-height: 1.4em;
letter-spacing: 0em;
}
.price {
margin-top: 30px;
margin-bottom: 30px;
font-size: 24px;
font-weight: 300;
font-style: normal;
color: #333333;
line-height: 1.37em;
letter-spacing: 0em;
}
.delivery {
text-decoration: underline;
font-size: 16px;
}
<seciton class="content">
<div class="content-wrap">
<div class="item"><img src="https://matakov.com/wp-content/uploads/2015/12/2015-11-15_13-52-10-200x300.jpg">
</div>
<div class="cont-text">
<h2>Кабель Lightning/ USB из комплекта iPhone</h2>
<p>Оригинальный кабель питания Lightning/ USB, который идет в комплекте с оригинальным iPhone.</p>
<p class="price">900р</p>
<a href="#" class="delivery">Купить с доставкой в Череповце</a>
</div>
</div>
<div class="content-wrap">
<div class="item"><img src="https://matakov.com/wp-content/uploads/2015/12/2015-11-15_13-52-10-200x300.jpg">
</div>
<div class="cont-text">
<h2>Кабель Lightning/ USB из комплекта iPhone</h2>
<p>Оригинальный кабель питания Lightning/ USB, который идет в комплекте с оригинальным iPhone.</p>
<p class="price">900р</p>
<a href="#" class="delivery">Купить с доставкой в Череповце</a>
</div>
</div>
</seciton>
Автор решения: MaximLensky
→ Ссылка
Примерно так
.item {
display: flex;
width: 600px;
height: 300px;
font-family: sans-serif;
margin: 10px auto;
}
.item img {
display: block;
width: 300px;
height: 100%;
}
.item p,
.item a {
margin: 0;
padding: 0;
}
.description {
width: 300px;
max-height: 300px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 10px 0 20px 20px;
}
.name {
text-transform: uppercase;
}
.surname {
font-size: 12px;
}
.price {
line-height: 10px;
}
.btn-color,
.btn-transparent {
text-decoration: none;
width: 200px;
height: 40px;
text-align: center;
line-height: 40px;
border-radius: 20px;
}
.btn-color {
background: lightblue;
color: #fff;
}
.btn-transparent {
border: 2px solid lightblue;
color: lightblue;
}
<div class="item">
<img src="http://placehold.it/300" alt="">
<div class="description">
<p class="name">Какое то название 1</p>
<p class="surname">Тут описание того что в названии, и очевидно этот товар очень важный так как его обязательно должны купить</p>
<p class="price">900</p>
<a href="#" class="offerta">Купить с доставкой по Москве</a>
<a href="#" class="btn-color">Добавить в карзину</a>
<a href="#" class="btn-transparent">Посмотреть прайс</a>
</div>
</div>
<div class="item">
<img src="http://placehold.it/300/cfc" alt="">
<div class="description">
<p class="name">Какое то название 2</p>
<p class="surname">Тут описание того что в названии, и очевидно этот товар очень важный так как его обязательно должны купить</p>
<p class="price">900</p>
<a href="#" class="offerta">Купить с доставкой по Москве</a>
<a href="#" class="btn-color">Добавить в карзину</a>
<a href="#" class="btn-transparent">Посмотреть прайс</a>
</div>
</div>