我$number
从表中获取数据,然后打印它:
echo "<div class='pagination'><a href='page_pagination.php?number=". $number ."' > ". $number ." </a></div>";
但。它不会在一行中打印,我已经使用 display inline 尝试过:
.pagination {
display: inline;
}
但它仍然不起作用。如何使它们排成一行?谢谢 :) var_dump($number) :
string(1) "2"
2
string(1) "3"
3
etc..
完整的:
<div id="page">
<?php
$query2 = mysql_query(" .....");
while ($row2 = mysql_fetch_array($query2)) {
....
echo '<div id="content">';
echo '<div class="post">';
...
echo '<div class="entry">';
...
}
echo '</div>';
echo '</div>';
$query3 = mysql_query(" ..... ");
while ($row3 = mysql_fetch_array($query3)) {
...
echo "<span class='pagination'><a href='page_pagination.php?number=". $number ."' > ". $number ." </a></span>";
}
echo '</div>';
?>
</div>
CSS:
#page {
width: 980px;
margin: 0 auto;
padding: 0px 220px 0px 0px;
border-top: 1px solid #b4c1a1;
background: #ffffff ;
}
#content {
width: 780px;
margin-top: 30px;
padding: 0px 0px 0px 40px;
background: url(images/img04.gif) no-repeat bottom;
}
.post {
margin-bottom: 15px;
}
.post .entry {
padding: 0px 0px 20px 0px;
padding-bottom: 20px;
text-align: justify;
}
呈现的 HTML:
<center><div id="pagination"><span><a href='page_pagination.php?number=2' > 2 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=3' > 3 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=4' > 4 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=5' > 5 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=6' > 6 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=7' > 7 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=8' > 8 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=9' > 9 </a></div>
<center><div id="pagination"><span><a href='page_pagination.php?number=Next' > Next </a></div>
这是显示渲染输出的链接= http://textuploader.com/?p=6&id=fferP