title: CSS: set border-color to parent's background-color
body: <p>assume the following snippet.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.parent {
    width: 300px;
    height: 300px;
    background-color: grey;
    display: flex;
  }
  
  .child {
    width: 50%;
    height: 50%;
    background: white;
    margin: auto;
    border: 5px dotted grey;
  }
  
  .parent:hover {
    background-color: darkcyan;
  }
  
  .parent:hover&gt;.child {
    border-color: darkcyan;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Note that the child-div has a border which has the same color like the parent-div.
  When hovering parent-div, its background-color changes while the border-color (actually I'm using -webkit-text-stroke) of the child-div changes to the same color.</p>
  
  <p>Instead of setting the child's border-color manually, I actually want the child to always use its parent background-color.
  This behaviour is easy to implement when both elements are using the same property by simply inheriting it. Is there any way to achive this behaviour using different properties?</p>
  
  <p>Thanks</p>