My goal is to create a layout with a thumbnail, two pieces of information stacked underneath, and options floating to the right. I have attempted to achieve this using the following HTML and CSS:
span.author_name {
font-size: 14px;
vertical-align: top;
color: #333;
margin-left: 4px;
}
span.comment_tools {
font-size: 14px;
vertical-align: top;
color: #939393;
float: right;
clear: both;
}
span.comment_tools a {
color: #939393;
-webkit-transition: color 500ms linear;
-moz-transition: color 500ms linear;
-ms-transition: color 500ms linear;
-o-transition: color 500ms linear;
transition: color 500ms linear;
}
span.comment_tools a:hover {
color: #1a7bbf;
}
span.date_time {
font-size: 14px;
vertical-align: bottom;
color: #939393;
margin-left: 4px;
}
span.author_name em { vertical-align: top; }
span.date_time em { vertical-align: bottom; }
<div class="author_metadata">
<img src="https://www.gravatar.com/avatar/7b3c9600bd9d213f52750ac083c1ac28?s=128&d=identicon&r=PG" height="32" width="32" />
<span class="author_name">Thomas Russell <em>says</em>:</span>
<span class="comment_tools"><a href="#">Edit</a> | <a href="#">Reply</a></span>
<span class="date_time">14th December 2014 <em>at</em> 1:38 am</span>
</div>
However, when implemented, the date_time
span appears slightly offset. How can I adjust my code to better align these elements, especially for use in a list of comments?