width
, height
, margin
can only work on a element that has dimension, aka block level element.
So you need to add the display: block
, or display: inline-block
properties to your <a>
To have them next to each other, you could 2 things: (notice that i fix some CSS issues in your code)
Float:
<p class="clearfix">
<a href="#" class="reply">foo</a>
<a href="#" class="reply">bar</a>
</p>
CSS:
.clearfix:after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
a.reply {
padding: 20px;
background-color: #555;
border-radius: 4px;
margin-top: 10px;
width: 100px;
height: 50px;
margin-right: 15px;
float: left;
}
a.reply:hover {
background-color: #fff;
}
Display inline-block
<p>
<a href="#" class="reply">foo</a>
<a href="#" class="reply">bar</a>
</p>
CSS:
a.reply {
padding: 20px;
background-color: #555;
border-radius: 4px;
margin-top: 10px;
width: 100px;
height: 50px;
display: inline-block;
margin-right: 15px;
}
a.reply:hover {
background-color: #fff;
}