簡體   English   中英

將按鈕並排放入CSS的while循環中

[英]Put button side by side in while loop in css

我是PHP的初學者,但是經驗豐富的人可以這么簡單,但是我嘗試學習。 我只是想並排添加按鈕,但是根據我的代碼,這是另一個。

while ($row_all = mysqli_fetch_assoc($result)) 
                {
                      echo '<form method="post">';
                        echo '<u>'.$row_all["product_name "].'</u>';
                        echo ' <button name="add_to_cart"  class="btn3" 
                        value='.$row_all['urun_adi'].' 
                        type="submit">'.$row_all["urun_adi"].'</button>';

                          echo '</form>';



                }

CSS代碼

  .btn3{
position: relative; 
top: 150px;
left: 1280px;   
width: 150px;
height: 100px;
border:5px solid white; 
color:yellow; 
font-weight:bold; 
font-family:Verdana; 
font-size:14px; 
background-color: green;
 }

嘗試這個 ! 在while之外創建表單

echo '<form method="post">';

while ($row_all = mysqli_fetch_assoc($result)) 
                {

                        echo '<u>'.$row_all["product_name "].'</u>';
                        echo ' <button name="add_to_cart"  class="btn3" 
                        value='.$row_all['urun_adi'].' 
                        type="submit">'.$row_all["urun_adi"].'</button>';



                }
 echo '</form>';

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM