Baseline Alignment for Header with Small Label
HTML
<h2 class="baselineLabel">
<span>HelloWorld</span>
<span><a href="#">View More</a></span>
</h2>
<p>enjoy – <a href="http://kai.me" target="_blank">kai.me </a></p>
CSS
/* your css */
body {
font-family: sans-serif;
}
p {
font-size: 12px;
}
h2 {
background-color: #f2f4f7;
font-size: 4em;
margin-bottom: .5em;
padding: .25em
}
/* align the baseline - setup */
.baselineLabel {
overflow: hidden;
}
.baselineLabel > span {
display: block;
float: right;
font-weight: normal;
}
.baselineLabel > span:first-child {
float: left;
font-weight: inherit;
}
.baselineLabel > span > a {
font-size: 14px;
}
/* align the baseline */
.baselineLabel > span::before {
content: "";
}