I want to reflect css in php value

Asked 1 months ago, Updated 1 months ago, 1 views

I would like to change the output position of the image file in the variable by reflecting css in the value of the variable in php, but for some reason, it is not reflected in the code below.
I would appreciate it if you could give me some advice.

The above variables contain five images of cards.
Here is the php code:

"<div class='player1_cards'>.".$player1."</div>";
 "<div class='player2_cards'>."$player2."</div>";


<css>
.player1_cards{
    background: #fff888;
    height —100px;
    position:absolute;
    top: 50%;
    left: 20%;
}

Now, even if I try to fix the output position of the card, it doesn't reflect at all. Why?
I apologize for the inconvenience, but I would appreciate it if you could let me know.

php css

2022-09-30 11:23

1 Answers

First of all, I'm not sure if the previous question has been resolved, but
There is no problem with the code listed.
If I have to say so, I'm only concerned about <css>.
(I think you just label it css when you ask a question, but of course it's <style> right?)
If you apply CSS to the output of the code from the previous question, you will see the following:

.player1_cards{
    background: #fff888;
    height —100px;
    position:absolute;
    top: 50%;
    left: 20%;
}

.player2_cards{
    background: #fff888;
    height —100px;
    position:absolute;
    top:0%;
    left: 20%;
}
<div class='player1_cards'>
  <img src="image/gif/spades_4.gif" alt="">
  <img src="image/gif/hearts_1.gif" alt="">
  <img src="image/gif/spades_9.gif" alt="">
  <img src="image/gif/clubs_9.gif" alt="">
  <img src="image/gif/clubs_6.gif" alt="">
</div>

<div class='player2_cards'>
  <img src="image/gif/clubs_11.gif" alt="">
  <img src="image/gif/diams_12.gif" alt="">
  <img src="image/gif/diams_13.gif" alt="">
  <img src="image/gif/hearts_7.gif" alt="">
  <img src="image/gif/hearts_10.gif" alt="">
</div>

First, try to resolve the previous question and make sure the output is correct.


2022-09-30 11:23

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.