【发布时间】:2015-10-18 05:12:25
【问题描述】:
<div class = "signupsubmit">Continue</div>
<style>
.signupsubmit {
line-height: 32px;
position: absolute;
left: 36px;
top: 527px;
font-family: arial;
font-size: 17px;
font-weight: 600;
width: 137px;
height: 30px;
border-color: #00297A;
border-radius: 4px;
border: 1px;
border-style: solid;
background-color: #FFB630;
text-indent: 30px;
}
</style>
我正在尝试将文本颜色更改为黑色,但保持边框颜色相同,所以这就是我所做的
<div class = "signupsubmit">Continue</div>
<style>
.signupsubmit {
line-height: 32px;
position: absolute;
left: 36px;
top: 527px;
font-family: arial;
font-size: 17px;
font-weight: 600;
width: 137px;
height: 30px;
border-color: #00297A;
border-radius: 4px;
border: 1px;
border-style: solid;
background-color: #FFB630;
text-indent: 30px;
color: white; <!-- NEW LINE OF CODE -->
}
</style>
我做了color:white,但它也将边框颜色更改为白色。我想保持边框颜色为黑色。
【问题讨论】:
-
@kannan:不需要。速记
border将border-color设置覆盖为默认值。只需要将border-color移动到border: 1px下方或将border: 1px更改为border-width: 1px。