I have an HTML structure like below, where I want the summary to show up right in the center (vertically and horizontally). And the 'just-in-tags' to be exactly 20px above (margin) the summary.
<div class="article-right aligner">
<div class="just-in-tags">
<span class="article-label tags tags--primary">Latest Best of the Web</span>
</div>
<div class="summary">
<h2 class="trending-header-text">
<a href="google.com">Hello World Hello World Hello World</a>
</h2>
</div>
</div>
I tried to do like shown in this codepen:
http://codepen.io/hellouniverse/pen/LbJoYY
The CSS I am trying is:
%aligner {
align-items: center;
display: flex;
justify-content: center;
}
.tags {
text-align: center;
margin-bottm: 20px;
}
.article-right {
width: 860px;
height: 320px;
background-color: grey;
@extend %aligner;
flex-direction: column;
}
However, everything is centered for me. I want the text of summary to be centered and the "Latest Best of the Web" to be exactly 20px above text of summary such that the the summary text still stays in the center vertically.
I am stuck. Any idea how to solve this issue?