【问题标题】:My Cssed Button in html table is not getting styled correctly phphtml 表中的我的 Cssed 按钮未正确设置样式 php
【发布时间】:2018-06-13 17:00:39
【问题描述】:

idk 我的脚本出了什么问题。该按钮应使用 css 进行样式设置,但我得到的只是 https://ibb.co/cuwixy

CSS

 .button {
background-color: #008CBA; /* Blue */
border: none;
color: white;
padding: 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button5 {border-radius: 50%;}

在 php echo 中的 html 表中编写脚本的按钮

  while($row = $result->fetch_assoc()) {
echo "<td><form class='button button5'><input type='button' name='buy' value='buy'/></form></td>";
echo "</tr>";
}

【问题讨论】:

    标签: php html css button


    【解决方案1】:

    您将课程放在表单上,​​而不是按钮上

    尝试:

    while($row = $result->fetch_assoc()) {
      echo "<td><form><input type='button' name='buy' value='buy' class='button button5'/></form></td>";
      echo "</tr>";
    }
    

    【讨论】:

    • 谢谢它的工作。另一个问题,如果你不介意,我该如何调整它的尺寸?因为它看起来很大
    • 使用widthheight
    • 对于完美视觉的宽度和高度值有什么建议吗?
    • 这超出了这里的范围。我不知道您正在构建什么、为什么、您拥有的其他 css、您正在使用的框架等。抱歉
    猜你喜欢
    • 2011-03-22
    • 1970-01-01
    • 2023-01-12
    • 1970-01-01
    • 2015-08-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多