我不能在div
中居中图像。给定以下标记,如何将图像居中?不能居中图像
的HTML代码如下:
<div id='post-area' style='background:#000; padding:20px 0;'>
<a class='fancybox' rel='group' href='example-big.png'>
<img src='example.png' />
</a>
</div>
CSS代码如下:
#post-area {
font-size:13px;
color:#000;
text-align:left;
width:450px;
height:auto;
font-family:Meera
clear:both;
margin-top:20px;
letter-spacing:normal;
}
#post-area img {
max-width:250px;
height:auto;
float:none;
margin:0 auto;
}
如果有什么办法做到这一点
*注:*你的CSS'字体family'财产是missi ng分号。此外,HTML应该有双引号,而不是单引号。 – arttronics 2012-07-23 02:27:39