我在 HTML 网页上看到按钮周围有边框。我正在尝试将一个按钮设为蓝色和一个绿色,并将它们放在桌子上。代码如下:
<table align="center">
<tr style=" font-family: verdana; font-size: 24px;">
<th> Select your Region </th>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<button>
<a id="cust" type="button"
style=
"background-color: #00824A;
border: none;
color: white;
padding: 16px 55px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
transition-duration: 0.4s;
cursor: pointer;
font-weight: bold;
font-family: verdana"
href="URL">
US
</a>
</button>
</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<button>
<a id="cust" type="button"
style=
"background-color: #0061D5;
border: none;
color: white;
padding: 16px 55px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
transition-duration: 0.4s;
cursor: pointer;
font-weight: bold;
font-family: verdana"
href="URL">
EU
</a>
</button>
</td>
</tr>
</table>
这是它们在网页上的显示方式:
我希望整个按钮都是那种颜色,周围没有灰色。我删除了样式中带有 border: none 的“边框”。相反,它在较大的灰色按钮内显示一个颜色矩形。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
边框是
设置按钮样式并删除默认边框button元素本身,而不是其中的链接。您需要使用相关阅读:https://css-tricks.com/overriding-default -按钮样式/