@I_want_to_know

Как расположить элемент снизу, под фото?

Всем доброго времени суток!
Друзья, подскажите пожалуйста, как разместить элемент
<div class="button-news">
            <a href="" class="full-news">Читать далее</a>
          </div>

В правом нижнем углу?
Суть вот в чем:
В мобильной версии, располагаю элементы друг под другом.
1 Заголовок;
2 Аннотация;
3 Картинка;
4 Кнопка "читать далее".
Проблема в том, что не могу понять как добраться до кнопки, что бы она встала в нужном мне месте и не выходила за пределы блока.
<div class="news-block flex">
      <div class="news-block__img">
        <img src="https://w.forfun.com/fetch/ef/ef6db98dba1405127f9836afd6593736.jpeg" alt="" />
      </div>
      <div class="row">
        <div class="news-block__info">
          <h2 class="news-title">Заголовок</h2>
          <p class="annotation">Далеко-далеко за словесными горами в стране гласных и согласных живут рыбные тексты.gdyhdvjgcfc fyuy ygy y y ygyugyggyg igggyghyg gygy Пор!</p>
          <div class="button-news">
            <a href="" class="full-news">Читать далее</a>
          </div>
        </div>
      </div>
    </div>


.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: 30px;
  margin-left: 30px;
  justify-content: center;
}
.news-section {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}
.news-block {
  width: 30rem;
  height: 15rem;
  border-radius: 5px;
  -webkit-box-shadow: 7px 10px 26px -4px rgba(34, 60, 80, 0.2);
  -moz-box-shadow: 7px 10px 26px -4px rgba(34, 60, 80, 0.2);
  box-shadow: 7px 10px 26px -4px rgba(34, 60, 80, 0.2);
  margin-bottom: 25px;
}
.news-block__info {
  width: 15rem;
  padding: 15px;
  height: auto;
  max-height: fit-content;
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.news-title {
  font-size: 20px;
  padding: 15px 0;
}
.annotation {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.full-news {
  text-decoration: none;
  font-size: 15px;
  padding: 10px 15px;
  background-color: red;
  color: #fff;
  border-radius: 5px;
  bottom: 15px;
  align-items: end;
}

.button-news {
  display: flex;
  justify-content: center;
  position: absolute;
  bottom: 25px;
}

.news-block__img {
  width: 15rem;
  height: auto;
}
.news-block__img img {
  clip-path: polygon(0% 0%, 100% 0%, 90% 50%, 100% 100%, 0% 100%);
  height: auto;
  min-height: 100%;
  max-width: 100%;
  object-fit: cover;
}

/*вспомогательные*/
.flex {
  display: flex;
}

h1,
h2,
h3,
h4,
h5,
h5 p,
.annotation {
  margin: 0;
  padding: 0;
}
/*media*/
@media (max-width: 520px) {
  .news-block {
    flex-direction: column;
    height: auto;
    
  }
  .news-block__img {
    width: 100%;
    order: 1;
    margin-bottom: 50px;
  }
  .news-block__img img {
    clip-path: none;
    border-radius: 5px;

  }
  .news-block__info {
    width: 100%;
  }
  .full-news {
    padding: 0;
    background-color: transparent;
    color: red;
    
    
  }
  .news-block .button-news {
  }

  .news-block {
    background-color: #ededed;
    -webkit-box-shadow: 0px 0px 0px 0px rgba(34, 60, 80, 0.2);
    -moz-box-shadow: 0px 0px 0px 0px rgba(34, 60, 80, 0.2);
    box-shadow: 0px 0px 0px 0px rgba(34, 60, 80, 0.2);
  }

  .news-block__info {
  }

  
}
  • Вопрос задан
  • 89 просмотров
Решения вопроса 1
IvanU7n
@IvanU7n
это идеальный вариант для грида, набросал приблизительно, чтобы была понятная идея:
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы