0
I set up a news feed that reads the information in a database, but I need that instead of each line being printed one after the other, I need to be given an interval between each print with a blank line (interval), in order to have something like this:
- printed news 01 (scroll the screen from right to left)
- interval (without information)
- printed news 02 (scrolls the screen from right to left)
The code I’m using is this:
<?php
//conexão + select
$query = mysql_query("SELECT");
if(mysql_num_rows($query)) { ?>
<p class="">
<ul class="">
<li class="">
<?php while($ln=mysql_fetch_array($query)) {
$feed=$ln['desc_noticias'];
?>
<?php echo $feed; ?>
<?php } ?>
</li>
<?php } ?>
</ul>
</p>
CSS:
.marquee {
width: 100%;
margin: 0 auto;
margin-top: 0;
overflow: hidden;
white-space: nowrap;
background-color: #20407B;
color: white;
box-sizing: border-box;
animation: marquee 50s linear infinite;
-webkit-animation: marquee 50s linear infinite;
}
.marquee:hover {animation-play-state: paused; -webkit-animation-play-state: paused; }
@keyframes marquee {
0% { text-indent: 27.5em }
100% { text-indent: -105em }
}
@-webkit-keyframes marquee {
0% { text-indent: 27.5em }
100% { text-indent: -105em }
}
It should be very easy, but I’m not seeing a solution. I appreciate the help!
bs.: the tips that have been given so far make all the records appear together, interspersed with blank lines, but this is not the solution I need, thanks anyway for the considerations, waiting for +help!
Show some of your code friend
– Andrei Coelho
<?php //connection + select $query = mysql_query("SELECT"); if(mysql_num_rows($query)) { ? > <p class=""> <ul class=""> <li class=""> <?php while($ln=mysql_fetch_array($query)) { $feed=$ln['desc_noticias']; ? > <?php echo $feed; ? > <?php } ? > </li> <?php } ? > </ul> </p>
– Eduardo Correia
Try adding a
<br/>
, after returning the result, this way:$feed=$ln['desc_noticias'] . "<br/>";
. Yet your code seems incomplete, and there’s not much you can do not know where the rest is.– Edilson
You can create a new div, inside the while(), after the $feed display, blank with this spacing... and each time a news appears, you will make the news print + spacing... or do a yes and no background color, to differ from each other
– Sr. André Baill
CSS: . Marquee {width: 100%; margin: 0 auto; margin-top: 0; overflow: Hidden; white-space: nowrap; background-color: #20407B; color: white; box-Sizing: border-box; Animation: Marquee 50s linear Infinite; -Webkit-Animation: Marquee 50s linear Infinite; } . Marquee:Hover {Animation-play-state: paused; -Webkit-Animation-play-state: paused; } @keyframes Marquee { 0% { text-indent: 27.5em } 100% { text-indent: -105em } } @-Webkit-keyframes Marquee { 0% { text-indent: 27.5em } 100% { text-indent: -105em } }
– Eduardo Correia