0

Всем привет, текст налазит на изображение. Должен стоять справа от изображений. Помогите, пожалуйста. Заранее спасибо

.description-container{
	width: 78.5%;
	display: flex;
	margin: 0 auto;
}
.img-block{
	display: flex;
	flex-direction: column;
}
.img-ud{
	display: flex;
	margin-left: 20px;
}
.img-ud img{
	width: 60%;
	padding: 5px;
}
.contact{
	display: flex;
	flex-direction: column;
}
<div class="description-container">
        <div class="img-block">
            <div class="img-ud">
                <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt="">
                <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt="">
            </div>
            <div class="img-ud">
                <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt="">
                <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt="">
            </div>
        </div>
        <div class="desc-block">
            <div class="contact">
                <a href="#">Lorem ipsum dolor sit amet</a>
                <a href="#">Lorem ipsum dolor sit amet</a>
                <a href="#">Lorem ipsum dolor sit amet</a>
            </div>
        </div>
        <div class="map"></div>
    </div>

1 ответ 1

1

У вас изображения выходят за пределы блока img-ud поскольку не указано свойство flex-wrap: wrap + изображения не адаптивны

.description-container {
  width: 78.5%;
  display: flex;
  margin: 0 auto;
}

.img-block {
  display: flex;
  flex-direction: column;
}

.img-ud {
  display: flex;
  flex-flow: row wrap;
  //margin-left: 20px;
}

.img-ud__item {
  padding: 5px;
  flex-basis: 50%;
  border: 1px solid #eaeaea;
  box-sizing: border-box;
}
img {
  max-width: 100%;
  height: auto;
  max-height: 100%;
}
.contact {
  display: flex;
  flex-direction: column;
}
.desc-block {
  flex: 0 0 200px;
}
<div class="description-container">
  <div class="img-block">
    <div class="img-ud">
      <div class="img-ud__item"> <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt=""></div>
      <div class="img-ud__item"> <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt=""></div>
    </div>
    <div class="img-ud">
      <div class="img-ud__item"> <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt=""></div>
      <div class="img-ud__item"> <img src="http://i5.otzovik.com/2016/02/20/2999864/img/22859706.jpeg" alt=""></div>
    </div>
  </div>
  <div class="desc-block">
    <div class="contact">
      <a href="#">Lorem ipsum dolor sit amet</a>
      <a href="#">Lorem ipsum dolor sit amet</a>
      <a href="#">Lorem ipsum dolor sit amet</a>
    </div>
  </div>
  <div class="map"></div>
</div>

4
  • а почему изображения в твоем случае не стоят по 2? 4 авг 2018 в 20:18
  • Потому что вы задали им ширину в 60%.
    – E_K
    4 авг 2018 в 20:23
  • в твоем ответе то нету ширины 4 авг 2018 в 20:29
  • а все, спасибо. 4 авг 2018 в 20:30

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.