📰 Blog Card
Карточка статьи блога с изображением и превью
← Назад к Карточки
Вертикальная
HTML
<article class="blog-card">
<div class="blog-image">
<img src="https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=500" alt="Blog">
<span class="blog-category">Technology</span>
</div>
<div class="blog-content">
<div class="blog-meta">
<span>📅 Dec 15, 2024</span>
<span>⏱️ 5 min read</span>
</div>
<h3 class="blog-title">The Future of Web Development</h3>
<p class="blog-excerpt">Exploring emerging trends and technologies shaping the future of web development...</p>
<div class="blog-footer">
<img src="https://i.pravatar.cc/40?img=5" alt="Author" class="blog-author-img">
<span class="blog-author">John Doe</span>
</div>
</div>
</article>
CSS
.blog-card {
width: 320px;
background: #ffffff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
}
.blog-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.blog-image {
position: relative;
width: 100%;
height: 200px;
overflow: hidden;
}
.blog-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.blog-card:hover .blog-image img {
transform: scale(1.05);
}
.blog-category {
position: absolute;
top: 12px;
left: 12px;
padding: 0.3rem 0.8rem;
background: rgba(102, 126, 234, 0.9);
color: white;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 600;
backdrop-filter: blur(10px);
}
.blog-content {
padding: 1.25rem;
}
.blog-meta {
display: flex;
gap: 1rem;
font-size: 0.8rem;
color: #999;
margin-bottom: 0.75rem;
}
.blog-title {
margin: 0 0 0.75rem;
font-size: 1.15rem;
font-weight: 700;
color: #1a1a2e;
line-height: 1.4;
}
.blog-excerpt {
margin: 0 0 1.25rem;
font-size: 0.9rem;
color: #666;
line-height: 1.6;
}
.blog-footer {
display: flex;
align-items: center;
gap: 0.5rem;
padding-top: 1rem;
border-top: 1px solid #eee;
}
.blog-author-img {
width: 32px;
height: 32px;
border-radius: 50%;
}
.blog-author {
font-size: 0.85rem;
font-weight: 600;
color: #1a1a2e;
}
Горизонтальная
HTML
<article class="blog-card-h">
<div class="blog-image-h">
<img src="https://images.unsplash.com/photo-1517694712202-14dd9538aa97?w=400" alt="Blog">
</div>
<div class="blog-content-h">
<span class="blog-tag-h">CSS</span>
<h3 class="blog-title-h">Mastering CSS Grid Layout</h3>
<p class="blog-excerpt-h">Learn how to create complex layouts with CSS Grid...</p>
<div class="blog-meta-h">
<span>📅 Dec 10</span>
<span>⏱️ 8 min</span>
</div>
</div>
</article>
CSS
.blog-card-h {
width: 480px;
max-width: 100%;
background: #ffffff;
border-radius: 12px;
overflow: hidden;
display: flex;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
}
.blog-card-h:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.blog-image-h {
width: 180px;
flex-shrink: 0;
overflow: hidden;
}
.blog-image-h img {
width: 100%;
height: 100%;
object-fit: cover;
}
.blog-content-h {
padding: 1.25rem;
flex: 1;
}
.blog-tag-h {
display: inline-block;
padding: 0.2rem 0.6rem;
background: rgba(102, 126, 234, 0.1);
color: #667eea;
border-radius: 4px;
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 0.5rem;
}
.blog-title-h {
margin: 0 0 0.5rem;
font-size: 1.1rem;
font-weight: 700;
color: #1a1a2e;
line-height: 1.3;
}
.blog-excerpt-h {
margin: 0 0 0.75rem;
font-size: 0.85rem;
color: #666;
line-height: 1.5;
}
.blog-meta-h {
display: flex;
gap: 1rem;
font-size: 0.75rem;
color: #999;
}
С градиентным фоном
HTML
<article class="blog-card-grad">
<div class="blog-content-grad">
<span class="blog-tag-grad">FEATURED</span>
<h3 class="blog-title-grad">Building Accessible Web Applications</h3>
<p class="blog-excerpt-grad">A comprehensive guide to creating inclusive experiences for all users...</p>
<div class="blog-footer-grad">
<img src="https://i.pravatar.cc/40?img=8" alt="Author" class="blog-author-img-grad">
<div>
<div class="blog-author-grad">Lisa Park</div>
<div class="blog-date-grad">Dec 12, 2024</div>
</div>
</div>
</div>
</article>
CSS
.blog-card-grad {
width: 320px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 16px;
padding: 1.75rem;
box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
transition: all 0.3s ease;
color: white;
}
.blog-card-grad:hover {
transform: translateY(-4px);
box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}
.blog-tag-grad {
display: inline-block;
padding: 0.3rem 0.8rem;
background: rgba(255, 255, 255, 0.2);
color: white;
border-radius: 20px;
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 1rem;
}
.blog-title-grad {
margin: 0 0 0.75rem;
font-size: 1.3rem;
font-weight: 700;
color: white;
line-height: 1.3;
}
.blog-excerpt-grad {
margin: 0 0 1.5rem;
font-size: 0.9rem;
color: rgba(255, 255, 255, 0.85);
line-height: 1.6;
}
.blog-footer-grad {
display: flex;
align-items: center;
gap: 0.75rem;
padding-top: 1rem;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.blog-author-img-grad {
width: 40px;
height: 40px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.3);
}
.blog-author-grad {
font-size: 0.9rem;
font-weight: 600;
color: white;
}
.blog-date-grad {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.7);
}