php call html with class

Asked

Viewed 125 times

0

   .up{
 color: #80006F;
}

.up:hover{
color: #CC00B1;
}

input{
margin-top:20px ; 
margin-left:0px ; 
margin-right:5px ;
margin-bottom:10px ;

}
.modal-header{
background: ;

}


@font-face {

  font-family: "polya";
  src: url("polya.otf")format("truetype");

  }


.amigo{
font-family: "polya";  
font-size: 100px;
   } 

#brand{
width: 30px;
height: auto;
}



.rodape{
background-color: #000;
margin: 0;
padding-right: 18px;
text-align: center;

}

img{
width: 20%;
}

li{
padding-right: 200px;
padding-left: 50px;

}

a{

font-size: 20px;

}

.Img{
width: 10%;
}

I just don’t know how to implement it. I’m trying to create html stuff with php and I wanted to set the size of an image with its class and call in php. Problem is when I call him in class he seems to ignore the class and runs without the setting.

            $result_produto = "SELECT * FROM produto";
        $resultado_produto = mysqli_query($conn, $result_produto);
        while($row_produto = mysqli_fetch_assoc($resultado_produto)){
            echo "ID: " . $row_produto['ID']. "<br>";
            echo "Nome do produto: " . $row_produto['Nome_produto']. "<br>";
            echo "Preço: " . $row_produto['Preco_produto']. "<br>";
            echo "Descrição do produto: " . $row_produto['Descricao_produto']. "<br>";
            foreach($imagem as $imagem){
            echo  '<img src="'.$imagem.'" class="Img"/>';
            }
        }
  • If in CSS you have the class .Img should be applied normally.

  • Is there anything that could be wrong ? because I’ve changed the class name several times and it really won’t =/

  • put the css file in your question, check if the classes are in agreement and press CTRL + J and then F5, can be cache....

  • is ... doesn’t really work, it even goes when I give inspect and configure but now in css it doesn’t even call

  • Put the css file in your question.

  • Okay, I think that’s how I wanted it

  • Do it the wrong way : change this line '<img src="'.$imagem.'" class="Img"/>'; for '<img src="'.$imagem.'" class="Img" style="width: 10%";/>';, if you really want to learn and take better advantage of the community consider reading [help] and executing the guidelines that those who want to help you ask for... Put the entire css file, not what you expect as a result...

  • This way you asked me to test really worked

  • You are implementing the css in the PHP file? <link rel="stylesheet" type="text/css" href="[ARQUIVO CSS]">

  • Yes, I even re-wrote because I thought I was wrong

  • I did what Magic did and it had worked but I went to inspect the page and it started calling the right class, after I took the style to see if the class started to work, I saw that I was really calling, I changed the value of the class to see if it changed but it it’s as if the n code updates more, only when you change something like the style

  • it’s working right now with css calling right, only have a php delay even pressing F5, I think... I think it’s a php bug pq did not change anything in the code other than the style that Magic asked to change and after I took this style css got normal

  • Each HTTP request is a different request. You must update with Ctrl+F5 or hit enter in the address bar. Should work better than a simple F5. Ctrl+F5 reloads the page without even touching the kk cache

  • @Breno so I told him to send one CTRL + J before... Only hand told to select disable cache... but it’s good he gets there...

  • thank you kkkk... I have a lot to learn yet. I just got busy because I did it from CTRL+J after F5 even though it hadn’t worked. but I’ll always do it from now on pq to update I just went on the link and gave enter even. Thank you both very much =)

Show 10 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.