【发布时间】:2015-05-25 23:52:31
【问题描述】:
我正在制作一个简单的网站,其中大多数都有一个顶部栏。当我为每个部分设计一个带有按钮的按钮时,我遇到了无法更改按钮字体颜色的问题。有人可以帮忙吗?我知道如何使用 div 但不知道如何使用按钮。这是我的代码:
<html>
<head>
<style>
button {
outline: none;
border-radius: 5px;
margin-top:5px;
color:#DEDEDE;
border:1px solid black;
height:30px;
margin-left: 15px;
margin-right: 15px
}
#bThree {
margin-right: 550px;
}
#topBar {
border-radius: 5px;
height: 40px;
width:100%;
background:blue;
background-color:#20AB53;
}
</style>
</head>
<body>
<div id="topBar">
<button id="bOne">About</button>
<button id="bTwo">Home</button>
<button id="bThree">Log In</button>
<button id="bFour">Sign Up</button>
<button id="bFive">Contact</button>
</div>
</body>
</html>
button {
outline: none;
border-radius: 5px;
margin-top: 5px;
color: #DEDEDE;
border: 1px solid black;
height: 30px;
margin-left: 15px;
margin-right: 15px;
}
#bThree {
margin-right: 550px;
}
#topBar {
border-radius: 5px;
height: 40px;
width: 100%;
background: blue;
background-color: #20AB53;
}
<div id="topBar">
<button id="bOne">About</button>
<button id="bTwo">Home</button>
<button id="bThree">Log In</button>
<button id="bFour">Sign Up</button>
<button id="bFive">Contact</button>
</div>
【问题讨论】:
-
你在
button上有color:#DEDEDE;,这对我来说很好。 -
它works perfectly well,你只需要使用对比度更高的颜色,such as #999,或者更暗。