0
我试图对齐我的元素在中心,但我在这个过程中有一些问题。我将“标题”排列在中心位置并且工作正常,现在我正在对其他元素执行相同的过程,但它不起作用。问题对齐在中心的元素
任何人都可以看到什么是错的?谢谢!
我的jsfiddle的问题:
http://jsfiddle.net/mibb/6SLa5/
我的HTML:
<section id="loop-news-container">
<article id="loop-news">
<a href="#"></a>
<h1><a href="#">Title</a></h1>
<span>Date of Post</span>
<img src="image1.jpg" />
<p>Post of 1 <a class="buttonl" href="#show" id="verfancy">read more</a></p></p>
</article>
我的CSS:
#loop-news-container{width:100%; height:auto; float:left;}
#loop-news{width:280px; height:250px; background:#fff; margin:5px auto 5px auto;}
#loop-news h1 {font-family:'bariol_boldbold'; text-align:center; font-family:'bariol_boldbold';margin:0 auto 0 auto; background:#F00;position:relative; text-decoration:none;}
#loop-news h1 a{text-decoration:none; font-size:20px; color:#002e5e; font-weight:100; }
#loop-news span{font-family:'bariolthin';font-size:14px; font-weight:normal;color:#888;margin:0 auto 0 auto; text-align:center; background-color:#FF0; }
你想要居中哪个元素?只是''? – Serlite
我想将所有元素对齐到中心。我已经做了标题,但其他元素不起作用,我不明白为什么。 – OzzC