Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 带有按钮的黄色背景色_Html_Css - Fatal编程技术网

Html 带有按钮的黄色背景色

Html 带有按钮的黄色背景色,html,css,Html,Css,我只设置了一个按钮,背景是黄色的,但它显示了两个黄色区域。作为我在下面发布的图片: 我只需要一个黄色背景下的文字 CSS: HTML: 链接和div按钮使用了两个相同的类。仅将其分配给一个元素(我猜您希望将其分配给外部div)。另外,如果你想要一个按钮,你应该使用或。我的坏。谢谢你的帮助。玩游戏: .button { margin-left: 121px; margin-top: 10px; width: 84px; height: 45px; background: yellow;

我只设置了一个按钮,背景是黄色的,但它显示了两个黄色区域。作为我在下面发布的图片: 我只需要一个黄色背景下的文字

CSS:

HTML:



链接和div按钮使用了两个相同的类。仅将其分配给一个元素(我猜您希望将其分配给外部div)。另外,如果你想要一个按钮,你应该使用或。我的坏。谢谢你的帮助。玩游戏:
.button {
margin-left: 121px;
margin-top: 10px;
width: 84px;
height: 45px;   
background: yellow;
border: none;
color: white;   
font-size:14px;
font-weight:700;
<div class="button">
<a href="#" class="button">button</a>
</div>