【发布时间】:2015-12-30 03:14:24
【问题描述】:
您好,我已经成功地在 css3 中进行了选取框转换,它从我的网站和数据库中滚动了我的 sql 数据,但我唯一的问题是我想要它,所以它下面永远没有任何空间,它会不断地继续运行任何人都可以请帮助下面是我的代码和css
提前致谢
display:block;
width: 500px;
position:absolute;
text-align: center;
animation-name: marquee;
-webkit-animation-name: marquee;
animation-duration: 60s;
-webkit-animation-duration: 60s;
animation-timing-function: linear;
-webkit-animation-timing-function: linear;
animation-iteration-count: infinite;
-webkit-animation-iteration-count:infinite;
animation-direction:normal;
-webkit-animation-direction:normal;
#marquee:hover {
-webkit-animation-play-state: paused;
animation-play-state: paused;
}
@keyframes marquee {
from { top: 100%; }
to { top: 0%; }
}
}
@-webkit-keyframes marquee {
from {top: 100%;}
to {top: 0%;}
}
<div id="main">
<div class="marquee">
<?php
require('connect.php');
$run = mysql_query("SELECT * FROM comment ORDER BY id DESC");
$numrows = mysql_num_rows($run);
if($numrows > 0){
while($row = mysql_fetch_assoc($run)){
$dbname = $row['name'];
$dbrating = $row['rating'];
$dbwebsite = $row['website'];
$dbservice = $row['service'];
$dbdate = $row['postdate'];
$dbcomment = $row['comment'];
$newDate = date("l dS F Y", strtotime($dbdate));
?>
<div id="commenttop">
<div id="userdetails"><?php echo "{$dbname} - {$dbservice}" ?></div>
<div id="rating">
<?php
if ($dbrating == 1) {
echo '<img src="images/activestar.png" width="20" height="20" /> <img src="images/star.png" alt="" width="20" height="20" /><img src="images/star.png" alt="" width="20" height="20" /><img src="images/star.png" alt="" width="20" height="20" /><img src="images/star.png" alt="" width="20" height="20" />';
}
if ($dbrating == 2) {
echo '<img src="images/activestar.png" width="20" height="20" /> <img src="images/activestar.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" />';
}
if ($dbrating == 3) {
echo '<img src="images/activestar.png" width="20" height="20" /> <img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" />';
}
if ($dbrating == 4) {
echo '<img src="images/activestar.png" width="20" height="20" /> <img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" /><img src="images/star.png" width="20" height="20" />';
}
if ($dbrating == 5) {
echo '<img src="images/activestar.png" width="20" height="20" /> <img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" /><img src="images/activestar.png" width="20" height="20" />';
}
?>
</div>
</div>
<div id="commentbtm"><?php echo "$dbcomment"?>
<div id="date"><?php echo $newDate?></div>
</div>
<?php
}
}
else
echo "No Comments Found";
?>
</div>
</div>
【问题讨论】: