CSS默认边框颜色
让我们有以下的HTML标记:
<div id="parent" class="parent">
    <div id="child" class="child">
    </div>
</div>
和相应的CSS样式:
.parent{
    border-style: solid;
    border-color: green;
    border-bottom: solid 10px;
    background:grey;
    width: 300px;
    height: 300px;
    padding: 10px;
}
.child{
    border: 20px solid;
    background: aqua;
    height: 50px;
    margin: 10px;
}
.parent {
  border-style: solid;
  border-color: green;
  border-bottom: solid 10px;
  background: grey;
  width: 300px;
  height: 300px;
  padding: 10px;
}
.child {
  border: 20px solid;
  background: aqua;
  height: 50px;
  margin: 10px;
}<div id="parent" class="parent">
  <div id="child" class="child">
  </div>
</div>您不能更改默认值。 浏览器将其定义为默认值。
如果你想继承父项的值(就像你提到的问题中的父项所暗示的那样),那么你必须明确地继承它。
.child {
    border-color: inherit;
}
  您也不能使用省略颜色值的速记border属性,因为这会将属性重置为默认值。 
.child {
    border-color: inherit;
    border-width: 20px;
    border-style: solid;
}
你也可以简单地明确:
.child {
    border-color: green;
    border-width: 20px;
    border-style: solid;
}
* { border-color: green; }
从性能角度不鼓励使用通配符选择器
  添加border-color: green;  在.child类中。  看到更新的小提琴 
下一篇: How to add a subview that has its own UIViewController in Objective
