2017-12-11 15 views
0

値が継承されると、インスペクタに表示されることがわかっています。 enter image description hereCssの継承された値がChromeのインスペクタに表示されない

<!DOCTYPE html> 
<html> 
<head> 
    <style> 
    div#outer {width: 500px;} 
    div#inner {text-indent: 10%; color: blue;} 
    /*p {width: 200px;}*/ 
</style> 
</head> 
<body> 

    <div id="outer"> 
     <div id="inner"> 
      This first line of the DIV is indented by 50 pixels. 
      <p> 
       This paragraph is 200px wide, and the first line of the paragraph 
       is indented 50px. This is because computed values for 'text-indent' 
       are inherited, instead of the declared values. 
      </p> 
     </div> 
    </div> 

</body> 
</html> 

私は、内側のdiv#の幅はのdiv#の外側から継承されていると思うが、それは、スタイルで何かとしてを継承されていない列を計算し表示されます。どうして?私は何かを誤解していますか? enter image description here

答えて

0

幅は継承されません。自動幅を持つインフローブロックボックスは、その包含ブロックが許す限り水平方向のスペースに収まるように拡張されますが、継承と同じではありません。

0

子供の表示プロパティに変更がないことを考慮して、内部html dom要素は常に親の幅をカバーします。

関連する問題