<article class="news">
<section class="news-section">
<div class="news-block">
<div class="news-block__img">
<img src="https://w.forfun.com/fetch/ef/ef6db98dba1405127f9836afd6593736.jpeg" alt="" />
</div>
<div class="news-block__info">
<h2 class="news-title">Заголовок</h2>
<p class="annotation">Далеко-далеко за словесными горами в стране гласных и согласных живут рыбные тексты. Назад продолжил проектах всемогущая правилами пустился всеми несколько, города, взгляд путь до ipsum своего возвращайся встретил языком агентство семантика за!</p>
</div>
<div class="button-news">
<a href="" class="full-news">Читать далее</a>
</div>
</div>
</section>
</article>
.news-section {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.news-block {
width: 30rem;
height: 15rem;
border-radius: 5px;
margin-bottom: 25px;
box-shadow: 7px 10px 26px -4px rgba(34, 60, 80, 0.2);
display: grid;
grid: 'image info' 'image button';
gap: 10px;
}
.news-block__info {
grid-area: info;
display: grid;
align-content: start;
justify-items: center;
}
.news-title {
font-size: 20px;
margin: 15px 0;
}
.annotation {
font-size: 15px;
overflow: hidden;
text-overflow: ellipsis;
display: box;
line-clamp: 2;
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 {
grid-area: button;
display: flex;
justify-content: center;
}
.news-block__img {
grid-area: image;
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;
}
/*вспомогательные*/
h1,
h2,
h3,
h4,
h5,
h5 p,
.annotation {
margin: 0;
padding: 0;
}
/*media*/
@media (max-width: 520px) {
.news-block {
height: auto;
grid: 'info' 'image' 'button';
}
.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;
box-shadow: 0px 0px 0px 0px rgba(34, 60, 80, 0.2);
}
.news-block__info {
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.