Por elementos in-line(lado a lado) com PHP
Oi gente,
Estou com dificuldade em deixar os meus elementos lado a lado com o PHP.
Gostaria de saber se alguém pode me ajudar.
Esse é o meu codigo <htlm>[
<section id="robe" class="mariage">
<div class="container">
<!--Titre -->
<div class="section-title">
<h2>Notre Selection</h2>
<p>ROBES</p>
</div>
<div class="row mariage-container">
<div class="col-lg-4 col-md-6 mariage-item">
<div class="mariage-wrap">
<div class="card-body">
<img src="assets/img/r2.png" class="img-fluid" alt="PHOTO ROBE FORME STRETCH">
<div class="mariage-info">
<h4>STRETCH</h4>
<p>190 €</p>
<a href="detail.php"><i class="fas fa-eye"></i> Détail</a>
<a href="#"><i class="fas fa-cart-plus"></i> Commander </a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>]
Dificulade em PHP
[code=php][/
<div class="site">
<?php
require ''marate/database.php'';
echo ''<nav class="nav-menu d-none d-lg-block">
<ul>'';
$db = Database::connect();
$statement = $db->query(''SELECT * FROM categories'');
$categories = $statement->fetchAll();
foreach ($categories as $category)
{
if($category[''id''] == ''1'')
echo ''<li class="active"><a href="#''. $category[''id''] . ''">'' . $category[''name''] . ''</a></li>'';
else
echo ''<li><a href="#''. $category[''id''] . ''">'' . $category[''name''] . ''</a></li>'';
}
echo ''</ul>
</nav>'';
//Section main
foreach ($categories as $category)
{
if($category[''id''] == ''1'')
echo ''<section class="mariage active" class="section-show mariage" id="'' . $category[''id''] .''">'';
else
echo ''<section class="mariage" class="section-show mariage" id="'' . $category[''id''] .''">'';
echo '' <div class="container">
<div class="section-title">
<h2>Notre Selection</h2>
<p>'' . $category[''name''] . ''</p>
</div>'';
$statement = $db->prepare(''SELECT * FROM items WHERE items.category = ?'');
$statement->execute(array($category[''id'']));
while ($item = $statement->fetch())
{
echo ''<div class="row">
<div class="col-md-4 mariage-item">
<div class="mariage-wrap">
<div class="card-body">
<img class="img-fluid" src="./assets/img/'' . $item[''image''] . ''" alt="...">
<div class="mariage-info">
<h4>'' . $item[''name''] . ''</h4>
<p>''. number_format($item[''price''], 2, ''.'', ''''). '' €</p>
<a href="detail.php?id=''.$item[''id''].''"><i class="fas fa-eye"></i> Détail</a>
<a href="#"><i class="fas fa-cart-plus"></i> Commander </a>
</div>
</div>
</div>
</div>
</div>'';
}
echo '' </div>
</section>
</section>'';
}
Database::disconnect();
?>
</div>]
Estou com dificuldade em deixar os meus elementos lado a lado com o PHP.
Gostaria de saber se alguém pode me ajudar.
Esse é o meu codigo <htlm>[
<section id="robe" class="mariage">
<div class="container">
<!--Titre -->
<div class="section-title">
<h2>Notre Selection</h2>
<p>ROBES</p>
</div>
<div class="row mariage-container">
<div class="col-lg-4 col-md-6 mariage-item">
<div class="mariage-wrap">
<div class="card-body">
<img src="assets/img/r2.png" class="img-fluid" alt="PHOTO ROBE FORME STRETCH">
<div class="mariage-info">
<h4>STRETCH</h4>
<p>190 €</p>
<a href="detail.php"><i class="fas fa-eye"></i> Détail</a>
<a href="#"><i class="fas fa-cart-plus"></i> Commander </a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>]
Dificulade em PHP
[code=php][/
<div class="site">
<?php
require ''marate/database.php'';
echo ''<nav class="nav-menu d-none d-lg-block">
<ul>'';
$db = Database::connect();
$statement = $db->query(''SELECT * FROM categories'');
$categories = $statement->fetchAll();
foreach ($categories as $category)
{
if($category[''id''] == ''1'')
echo ''<li class="active"><a href="#''. $category[''id''] . ''">'' . $category[''name''] . ''</a></li>'';
else
echo ''<li><a href="#''. $category[''id''] . ''">'' . $category[''name''] . ''</a></li>'';
}
echo ''</ul>
</nav>'';
//Section main
foreach ($categories as $category)
{
if($category[''id''] == ''1'')
echo ''<section class="mariage active" class="section-show mariage" id="'' . $category[''id''] .''">'';
else
echo ''<section class="mariage" class="section-show mariage" id="'' . $category[''id''] .''">'';
echo '' <div class="container">
<div class="section-title">
<h2>Notre Selection</h2>
<p>'' . $category[''name''] . ''</p>
</div>'';
$statement = $db->prepare(''SELECT * FROM items WHERE items.category = ?'');
$statement->execute(array($category[''id'']));
while ($item = $statement->fetch())
{
echo ''<div class="row">
<div class="col-md-4 mariage-item">
<div class="mariage-wrap">
<div class="card-body">
<img class="img-fluid" src="./assets/img/'' . $item[''image''] . ''" alt="...">
<div class="mariage-info">
<h4>'' . $item[''name''] . ''</h4>
<p>''. number_format($item[''price''], 2, ''.'', ''''). '' €</p>
<a href="detail.php?id=''.$item[''id''].''"><i class="fas fa-eye"></i> Détail</a>
<a href="#"><i class="fas fa-cart-plus"></i> Commander </a>
</div>
</div>
</div>
</div>
</div>'';
}
echo '' </div>
</section>
</section>'';
}
Database::disconnect();
?>
</div>]
Mario
Curtidas 0
Respostas
Luiz
10/06/2021
O que exatamente você quer deixar um ao lado do outro, me mostre a linha.
GOSTEI 0