【问题标题】:How do I change the color of text in my button? [closed]如何更改按钮中文本的颜色? [关闭]
【发布时间】: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>

【问题讨论】:

标签: html css


【解决方案1】:

http://jsfiddle.net/zakCa/1/

.button {
    color: green;
}

【讨论】:

    猜你喜欢
    • 2021-11-12
    • 1970-01-01
    • 2012-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-05
    • 2013-06-05
    • 2019-02-14
    相关资源
    最近更新 更多