Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <style>
    /* 使子元素继承了那些不会被自动继承的属性 */
    .box{
      border:2px solid black;
      padding:5px;
      background:#ccc;
      height:100px;
    }
    .box div{
      /* 使用inherit能继承父级的属性,和auto不一样 */
      border:inherit;
      padding:inherit;
      height:auto;
    }
  </style>
</head>
<body>
  <div class='box'>
    <div>儿子</div>    
  </div>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
Megasupro
0viewers