Jump to content
  • 0
Jack Oliveira

BUSCANDO IMAGEM DO BANCO DE DADOS MOSTRA NO CSS

Question

Ola pessoal

estou tentando buscar as imagem do banco de dados atraves do css mais ele não esta dando certo fazer isso

<style>
 .chamar_img{
    background:url(<?php echo ConfigPainel('site_url'); ?>imagem/cidades/<?php echo $imagem; ?>) no-repeat center;
    max-width:262px;
    height:262px;
    border-radius:5px;
    position:relative;
    padding:20px;
    overflow:hidden;
    text-align:center;
    margin:0 auto 30px
}
.chamar_img:after{
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:100%;
    width:100%;
    content:"";
    background:rgba(0,0,0,0.5)
}
.city_listings_info{
    position:absolute;
    left:0;
    right:0;
    top:50%;
    transform:translateY(-50%);
    -moz-transform:translateY(-50%);
    -o-transform:translateY(-50%);
    -webkit-transform:translateY(-50%);
    -ms-transform:translateY(-50%);
    transition-duration:.3s;
    -moz-transition-duration:.3s;
    -o-transition-duration:.3s;
    -webkit-transition-duration:.3s;
    -ms-transition-duration:.3s;
    z-index:1
}
.city_listings_info h4{
    color:#fff;
    font-weight:500;
    margin-bottom:20px;
    transition-duration:.3s;
    -moz-transition-duration:.3s;
    -o-transition-duration:.3s;
    -webkit-transition-duration:.3s;
    -ms-transition-duration:.3s;
    transform:translateY(20px);
    -moz-transform:translateY(20px);
    -o-transform:translateY(20px);
    -webkit-transform:translateY(20px);
    -ms-transform:translateY(20px)
}
.overlay_link{
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    content:"";
    z-index:2
}
.listing_number{
    position:relative;
    opacity:0;
    transition-duration:.3s;
    -moz-transition-duration:.3s;
    -o-transition-duration:.3s;
    -webkit-transition-duration:.3s;
    -ms-transition-duration:.3s;
    transform:translateY(150px);
    -moz-transform:translateY(150px);
    -o-transform:translateY(150px);
    -webkit-transform:translateY(150px);
    -ms-transform:translateY(150px)
}
.listing_number span{
    border:2px solid rgba(255,255,255,0.3);
    border-radius:3px;
    color:#fff;
    display:inline-block;
    font-size:17px;
    font-weight:300;
    line-height:16px;
    padding:9px 20px
}
.chamar_img:hover h4,.chamar_img:hover .listing_number{
    transform:translateY(0px);
    -moz-transform:translateY(0px);
    -o-transform:translateY(0px);
    -webkit-transform:translateY(0px);
    -ms-transform:translateY(0px);
    opacity:1
}
</style>
<div class="row">
<?php
mysqli_set_charset($conn,"utf8");
$sql = mysqli_query($conn,"select * from cidades  WHERE status = 'S' order by id DESC LIMIT 12");
//$visitas = mysqli_num_rows($sql);
while ($dados=mysqli_fetch_array($sql)){
    $id = $dados["id"]; $titulo = $dados["titulo"]; $imagem = $dados["imagem"]; 
	 $status = $dados["status"]; $estado = $dados["estado"];
?>			
<?php if($status == 'S') { ?>	
            <div class="col-sm-6 col-md-3">
            	<div class="chamar_img">
                    <div class="city_listings_info">
                    	<h4><?php echo $dados["titulo"]; ?> - <?php echo $dados["estado"]; ?></h4>
                        <div class="listing_number"><a href="#" class="overlay_link"><span>Visitar Cidade</span></a> </div></br/><br/>
						  <div class="listing_number"><a href="#" class="overlay_link"><span>Saiba mais sobre a cidade</span></a> </div>
                    </div>
                    
                </div>
            </div>
<?php } } ?>  
        </div>
        <div class="text-center">
        	<a href="#" class="btn">Veja mais cidades...</a>
        </div>

Ele mostra tudo do banco de dados mais só as imagem que não aparecem no box-grid

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.