php - 我在 html 表中的 Cssed 按钮没有得到正确的样式 php

标签 php html css button

我知道我的脚本有什么问题。该按钮应使用 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 回显中的 html 表中编写脚本的按钮

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

最佳答案

你把类放在表单上,​​而不是按钮上

尝试:

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

关于php - 我在 html 表中的 Cssed 按钮没有得到正确的样式 php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50842613/

相关文章:

php - 为什么 Behat PHP 命令在终端中有效,但在 Jenkins 中无效?

php - 如何将 jQuery 语句应用于在运行时加载的元素?

javascript - 如何隐藏 HTML 按钮

php INSERT 到变量名 MySQL 的列

php - 如何在phpMyAdmin中查看/更改数组的内容

php - 列出 sql 到 html 页面上的所有用户

css - 在 bootstrap 3 的小屏幕上更改类样式?

html - div : believe it to be due to the svg background 内的按钮不可点击

html - 如何让图像显示在每个 <li> 上方

html - 带有子菜单的简单列表菜单不起作用