当结果不超过1页时,MYSQL结果显示错误

时间:2014-12-05 03:12:54

标签: mysql css

您好我有一个我正在处理的页面,它从数据库中获取文章。结果使用php分割,每页显示六篇文章。我遇到的问题是,如果有七个结果,我们进入第2页,那么一切都很好,可以在时计菜单按钮下看到。

然而,如果只有少于6篇文章而且只有一页,那么第一篇文章就会变得有趣,文字会落在图像下方,如私人航空按钮下所示。

该网站的链接位于:http://goo.gl/N8p8CT

这两个项目似乎都在article.row.mid中,因此我正在努力找出原因。

1 个答案:

答案 0 :(得分:0)

因为第一篇文章将图像包装成<a></a>标签,但第二篇文章没有,这两个图像由不同的css规则呈现。 enter image description hereenter image description here 第一个是botstrap.css规则的样式,第二个是你自己的样式表。 无论如何,如果你使用bootstrap,那么最好将文章的图像包装到div中,以便使用bootstrap网格更好地对齐。 我会这样做:

<article class="row mid">
<div class="col-xs-4">
<a href="https://www.flyvictor.com/?utm_source=display&amp;utm_medium=leaderbanner&amp;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&amp;utm_medium=leaderbanner&amp;utm_campaign=tempus20141010" target="_blank">
                            </a><h1><a href="https://www.flyvictor.com/?utm_source=display&amp;utm_medium=leaderbanner&amp;utm_campaign=tempus20141010" target="_blank"></a><a href="article.php?id=111&amp;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>
相关问题