0
<?php
require_once 'Postagem/system/config.php';
require_once 'Postagem/system/database.php';
?>
<!DOCTYPE html>
<html lang="pt-BR">
<?php include 'include/head.php'; ?>
<?php include 'include/nav.php'; ?>
<div class="card mb-3">
<img class="card-img-top" src="img/cap.png" alt="Card image cap">
<div class="card-block">
<h4 class="card-title"><span style="margin-left: 15px;">Forex</span></h4>
<p class="card-text"><span style="margin-left: 15px;">O maior site de conteudo forex da America Latina.</p>
<p class="card-text"><small class="text-muted"></span></small></p>
</div>
</div>
<style type="text/css">
.inserirLayout{
height:auto;
width: auto;
}
.inserirLayout li{
list-style-type: none;
float: left;
text-align: right;
padding: 0 15px 0;
display: block;
height:40px;
}
</style>
<!--Exibindo alguns dados-->
<main>
<?php
$posts = DBRead('posts', "WHERE status = 1 ORDER BY data DESC");
if (!$posts)
echo '<h2>Nenhuma postagem encontrada!</h2>';
else
foreach ($posts as $post):
?>
<ul class="inserirLayout">
<li>
<div class="card" style="width: 20rem; ">
<img class="card-img-top" src="Postagem/painel/uploads/<?php echo $post['image_text']; ?>" alt="Card image cap" height="318px" width="180px">
<div class="card-body">
<h4 class="card-title">
<a href="Postagem/exibe.php?id=<?php echo $post['id']; ?>" title="<?php echo $post['titulo']; ?>">
<?php echo $post['titulo']; ?></h4>
</a>
<p class="card-text">
<?php
$str = strip_tags($post['conteudo']);
$len = strlen($str);
$max = 500;
if ($len <= $max)
echo $str;
else
echo substr($str, 0, $max) . '...';
?>
</p>
<p class="card-text"><small class="text-muted"><?php echo date('d/m/Y', strtotime($post['data'])) ?>
, Visitas <b><?php echo $post['visitas']; ?></b>,
por <b><?php echo $post['autor']; ?></b>
</small>
</p>
<a href="Postagem/exibe.php?id=<?php echo $post['id']; ?>" title="<?php echo $post['titulo']; ?>" class="btn btn-primary">Leia a Materia</a>
</div>
</div>
</li>
</ul>
<?php endforeach; ?>
</main>
</html>
I want him to print the vertical line posting of 3 every time 3 posting on a vertical line he jumps the line
I need that help
Hello Vitor! You are from Portugal?
– Sam
Hello, I’m from Brazil
– Vitor Giovanny
Your question got confused. It wouldn’t be "horizontal line" instead of "vertical line"?
– Sam
Because "line" usually means "horizontal", while "vertical" has more to do with "column".
– Sam
horizontal in the case
– Vitor Giovanny
Got it. The answer below solves?
– Sam
Not yet, he’s jumping, and he’s not making you whole or 3 ,
– Vitor Giovanny
So it’s because 3 doesn’t fit on the screen on the same line.
– Sam
http://farolandia.atspace.cc/png/
– Vitor Giovanny
to see if it’s easy
– Vitor Giovanny
The idea is the answer of @Cayo Henrique Rodrigues... Put a
<br clear="all" />
instead of<br />
, and in the CSS remove theheight:40px;
, which, by the way, I don’t know what it’s for.– Sam
Has a tag
<h4>
with a<a>
inside and you glued one</h4>
within the<a>
... this tah wrong too– Sam
Your HTML would look something like this: https://jsfiddle.net/m3w6bypm/
– Sam
Thanks, it worked out
– Vitor Giovanny
How nice. Success!
– Sam