【发布时间】:2016-01-05 17:35:32
【问题描述】:
我想知道,是否可以在边框半径后面设置背景颜色?
我使用这个 HTML:
<div class="content-header" tabindex="-1">
<span class="html">TITLE</span>
</div>
<div class="content-txt-v2" tabindex="-1">
<p>
Content
</p>
</div>
我使用这个 CSS:
.content-header {
height: 18px;
line-height: 18px;
background-color: #4C741B;
margin-top: 20px;
float: left;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-radius: 10px 10px 0px 0px;
-khtml-border-radius: 10px 10px 0px 0px;
border-radius: 10px 10px 0px 0px;
padding: 0px 14px;
font-weight: bold;
font-size: 14px;
color:#fff;
}
.content-txt-v2 {
clear: both;
width: 669px;
padding: 0 10px;
margin: 0px auto;
border: 2px solid #E9EAE3;
-moz-border-radius: 20px 10px 10px 10px;
-webkit-border-radius: 20px 10px 10px 10px;
-khtml-border-radius: 20px 10px 10px 10px;
border-radius: 20px 10px 10px 10px;
float:left;
background-color:red;
}
我在JSFIDDLE中添加了上面的代码
我尝试设置我的 content-txt-v2 div 的背景颜色,但没有成功。谁能指导我正确的方向?只有两个div有可能吗?还是应该添加更多对象?
【问题讨论】: