I am having trouble开发者_StackOverflow中文版 centering these two elements. I'm not sure what my problem is. Hopefully someone can help me out. First here is an screenshot of what is going on:
So how do I get these elements vertically centered?
Here is my HTML and CSS:
<div class="vcenter">
<p>
<a href="http://www.google.com">JimDaniel</a>
<a href="http://www.cnn.com"><img src="icon.png"/></a>
</p>
</div>
.vcenter
{
padding:10px;
background-color:darkBlue;
min-height: 25px;
display: table-cell;
vertical-align: middle;
}
Thanks for the help!
Like this?
http://jsbin.com/opifu5
.vcenter img {
vertical-align: top
}
精彩评论