您好,我正在处理一个页面,该页面从数据库中获取文章。结果使用 php 进行拆分,每页显示六篇文章。我遇到的问题是,如果有七个结果并且我们滚动到第 2 页,那么一切都很好,正如可以在计时器菜单按钮下看到的那样。
但是,如果文章少于 6 篇且只有一页,那么第一篇文章会变得有趣,文本会下降到图像下方,如私有(private)航空按钮下方所示。
网站链接在这里:http://goo.gl/N8p8CT
这两项似乎都在 article.row.mid 中,所以我正在努力找出原因。
最佳答案
因为第一篇文章的图像包裹在<a></a>
中标签,但第二篇文章没有,这两张图片是由不同的css规则渲染的。
和
第一个由 botstrap.css 规则设置样式,第二个由您自己的样式表设置。
无论如何,如果你使用 Bootstrap ,那么最好将文章图像包装到一个 div 中,以便使用 Bootstrap 网格更好地对齐。
我会这样做:
<article class="row mid">
<div class="col-xs-4">
<a href="https://www.flyvictor.com/?utm_source=display&utm_medium=leaderbanner&utm_campaign=tempus20141010" target="_blank">
<img src="admin/images/private_jet_hanger-1413201025.jpg" alt="post1" height="250px" width="250px">
</a>
</div>
<div class="col-xs-8 info"><a href="https://www.flyvictor.com/?utm_source=display&utm_medium=leaderbanner&utm_campaign=tempus20141010" target="_blank">
</a><h1><a href="https://www.flyvictor.com/?utm_source=display&utm_medium=leaderbanner&utm_campaign=tempus20141010" target="_blank"></a><a href="article.php?id=111&tag1=private_aviation">Jet Partner launches empty leg service...</a></h1>
<p class="details"></p>
<p class="tags"></p>
<p class="text">
</p><p>The advantages associated with private jet travel are invaluable: the ability to journey in comfort, security and privacy; to arrive at the airport just 15 minutes before take-off and to completely avoid check-in. Now, the advent of groundbreaking </p>
<a href="article.php?id=111" class="btn btn-default" "="">Read More</a> <ul class="counters list-inline">
</ul>
</div>
</article>
关于结果不超过1页时MYSQL结果显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27308129/