两个项目,内容和页脚之间有很多额外的空间 我希望它在内容较少的情况下动态,项目与内容和页脚之间不应有空格。 当数据超过它应该推下分页和页脚相同
这是css
pagination.css
ul.pagination{
margin-left:670px;
margin-top: 700px;
padding: 75px 0px 0px 0px;
overflow:hidden;
font:12px 'Tahoma';
list-style-type:none;
}
ul.pagination li.details{
padding:7px 10px 7px 10px;
font-size:14px;
}
ul.pagination li.dot{padding: 3px 0;}
ul.pagination li{
float:left;
margin:0px;
padding:0px;
margin-left:5px;
}
ul.pagination li:first-child{
margin-left:0px;
}
ul.pagination li a{
color:black;
display:block;
text-decoration:none;
padding:7px 10px 7px 10px;
}
ul.pagination li a img{
border:none;
}
.item
border-radius: 25px;
padding: 20px;
background-color:white;
position: absolute;
margin:10px;
margin-top:40px;
margin-left:0px;
margin-right:10px!important;
width: 300px;
height: auto;
float: left;
background: #ffff;
font-size:20px !important;
text-align:center;
display: block;
line-height: 1.42857143;
html
<div id='masonry'>
<?php
//show records
$query = mysqli_query($con,"SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}");
if($query === FALSE) {
die(mysqli_error($db)); // TODO: better error handling
}
$count=1;
while ($row = mysqli_fetch_assoc($query)) {
$quote=$row['quote'];
$name =$row['name'];
?>
<div class="item">
<?php echo "{$quote}";?><br>
<?php echo "Author:- {$name}";?>
</div>
<?php
$count++;
}
?>
</div>
<script src='masonry.pkgd.min.js'></script>
<script>
var container = document.querySelector('#masonry');
var masonry = new Masonry(container, {
columnWidth: 50,
itemSelector: '.item'
});
</script>
<div id = "popular">
<span> <h3> Popular Author </h3></span>
<?php
$query1=mysqli_query($con,"SELECT * FROM `author` WHERE popular = 1 ORDER BY `name` ASC LIMIT 35 ");
if($query1 === FALSE) {
die(mysqli_error($db)); // TODO: better error handling
}
while ($row = mysqli_fetch_assoc($query1)) {
$name =$row['name'];
$id =$row['id'];
?>
<div class="pop1">
<a href="quotes.php?auth_id=<?php echo "$id";?>"><?php echo "$name";?></a>
</div>
<?php
$count++;
}
?>
</br>
<a href='popular_authors.php' class='button'>more popular author</a>
</div>
<?php echo pagination($statement,$limit,$page);?>
<div style="margin-top:0px"><?php include('footer.php');?></div>
</body>
</html>