The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blog Cards</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="blog-card">
<div class="meta">
<div class="photo"></div>
<ul class="details">
<li class="author"><a href="#">Author 1</a></li>
<li class="date">21 May 2023</li>
<li class="tags">
<ul>
<li><a href="#">Tag1</a></li>
<li><a href="#">Tag2</a></li>
<li><a href="#">More Tags</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Title Blog 1</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Deserunt perspiciatis neque, quis quibusdam,
odit eos ipsa in vel quas omnis ad corporis voluptate numquam laboriosam asperiores, tempora illo
praesentium dolorum.</p>
<p class="read-more"><a href="#">Read More</a></p>
</div>
</div>
<div class="blog-card alt">
<div class="meta">
<div class="photo"></div>
<ul class="details">
<li class="author"><a href="#">Author 2</a></li>
<li class="date">20 May 2023</li>
<li class="tags">
<ul>
<li><a href="#">Tag1</a></li>
<li><a href="#">Tag2</a></li>
<li><a href="#">More Tags</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Title Blog 2</h1>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Assumenda neque aut culpa repellat quia
esse excepturi dolorem officiis. Ipsa rem voluptas nihil excepturi, perspiciatis nam odio asperiores
commodi sunt hic?</p>
<p class="read-more"><a href="#">Read More</a></p>
</div>
</div>
</div>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
width: 100%;
background: #cedfd9;
color: #9b6a6c;
font-family: sans-serif;
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 82%;
}
.blog-card {
display: flex;
flex-direction: row;
background: #ebfcfb;
border-radius: 4px;
box-shadow: 0 1px 4px 4px #5f54491a;
margin-bottom: 2%;
z-index: 0;
overflow: hidden;
}
.blog-card.alt {
flex-direction: row-reverse;
margin-bottom: 0;
}
.blog-card .meta {
position: relative;
flex-basis: 40%;
height: auto;
z-index: 0;
}
.blog-card .photo {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: url(https://images.unsplash.com/photo-1488190211105-8b0e65b80b4e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
transition: transform 0.25s;
}
.blog-card.alt .photo {
background-image: url(https://images.unsplash.com/photo-1487611459768-bd414656ea10?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80);
}
.blog-card .details, .blog-card .details ul {
list-style: none;
margin: auto;
}
.blog-card .details {
position: absolute;
top: 0;
left: -100%;
bottom: 0;
width: 100%;
background: #9b6a6c99;
color: #ebfcfb;
font-size: 12px;
padding: 10px;
transition: left 0.25s;
}
.blog-card.alt .details {
padding-left: 25px;
}
.blog-card .details ul li {
display: inline-block;
}
.blog-card .details a {
text-decoration: dotted underline;
}
.blog-card .details .author::before, .blog-card .details .date::before, .blog-card .details .tags ul::before {
content: "->";
margin-right: 10px;
}
.blog-card .details .tags li {
margin-right: 2px;
}
.blog-card .details .tags li:first-child {
margin-left: -4px;
}
.blog-card .description {
position: relative;
background: #ebfcfb;
flex-basis: 60%;
padding: 15px;
z-index: 1;
}
.blog-card .description::before {
content: "";
position: absolute;
top: 0;
left: -10px;
bottom: 0;
transform: skewX(-2deg);
width: 30px;
background: #ebfcfb;
z-index: -1;
}
.blog-card.alt .description::before {
left: inherit;
right: -10px;
transform: skewX(2deg);
}
.blog-card .description h1 {
font-size: 20px;
}
.blog-card p {
position: relative;
margin: 15px 0 0;
}
.blog-card p:first-of-type::before {
content: "";
position: absolute;
top: -8px;
height: 5px;
width: 35px;
background: #5f5449;
border-radius: 4px;
}
.blog-card .description .read-more {
text-align: right;
}
.blog-card .description .read-more a {
position: relative;
display: inline-block;
color: #5f5449;
}
.blog-card .description .read-more a::after {
content: "->";
margin-left: -10px;
vertical-align: middle;
opacity: 0;
transition: margin 0.5s, opacity 0.5s;
}
.blog-card a {
color: inherit;
}
.blog-card:hover .photo {
transform: rotate(4deg) scale(1.5);
}
.blog-card:hover .details {
left: 0;
}
.blog-card .description .read-more a:hover::after {
margin-left: 5px;
opacity: 1;
}
.blog-card a:hover {
color: #ebfcfbbf;
}
Thanks for visiting