<main class="main columns">
<section class="column main-column">
<a class="article first-article" href="#">
<figure class="article-image is-4by3">
<img src="https://s3.amazonaws.com/cms-assets.tutsplus.com/uploads/users/1366/posts/26611/attachment/image-01.png" alt="">
</figure>
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
<a class="article" href="#">
<figure class="article-image is-16by9">
<img src="https://s3.amazonaws.com/cms-assets.tutsplus.com/uploads/users/1366/posts/26611/attachment/image-02.png" alt="">
</figure>
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
</section>
<section class="column">
<a class="article" href="#">
<figure class="article-image is-3by2">
<img src="https://s3.amazonaws.com/cms-assets.tutsplus.com/uploads/users/1366/posts/26611/attachment/image-03.png" alt="">
</figure>
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
<a class="article" href="#">
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
<a class="article" href="#">
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
<a class="article" href="#">
<div class="article-body">
<h2 class="article-title">
Hello World
</h2>
<p class="article-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<footer class="article-info">
<span>By Joe Smith</span>
<span>42 comments</span>
</footer>
</div>
</a>
</section>
</main>
html {
background: mediumseagreen;
font-family: sans-serif;
font-size: 14px;
}
a {
text-decoration: none;
}
div, h2, p, figure {
margin: 0;
padding: 0;
}
.main {
margin: 0 auto;
max-width: 1040px;
padding: 20px;
}
.columns {
display: flex;
}
.column {
display: flex;
flex: 1;
flex-direction: column;
}
.main-column {
flex: 2;
}
.article {
background: white;
color: #666;
display: flex;
flex: 1;
flex-direction: column;
flex-basis: auto;
margin: 10px;
}
.article-image {
background: #eee;
display: block;
padding-top: 75%;
position: relative;
width: 100%;
}
.article-image img {
display: block;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
.article-image.is-3by2 {
padding-top: 66.6666%;
}
.article-image.is-16by9 {
padding-top: 56.25%;
}
.article-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 20px;
}
.article-title {
color: #333;
flex-shrink: 0;
font-size: 1.4em;
font-weight: bold;
font-weight: 700;
line-height: 1.2;
}
.article-content {
flex: 1;
margin-top: 5px;
}
.article-info {
display: flex;
font-size: 0.85em;
justify-content: space-between;
margin-top: 10px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.