「CSS」inheritでスタイル(style)を継承するサンプル
書式
margin-right: inherit
使用例
<style>
.cftA {
border: dashed 4px green;
}
.cftB {
margin-right: 10px;
border: dashed 5px blue;
}
.cftC {
margin-right: inherit;
border: dashed 6px red;
}
</style>
<div class="cftA">
AA 11
<div class="cftB">
BB 22
<div class="cftC">CC 33</div>
</div>
</div>
<style>
.cftA {
border: dashed 4px green;
}
.cftB {
margin-right: 10px;
border: dashed 5px blue;
}
.cftC {
margin-right: inherit;
border: dashed 6px red;
}
</style>
<div class="cftA">
AA 11
<div class="cftB">
BB 22
<div class="cftC">CC 33</div>
</div>
</div>
<style> .cftA { border: dashed 4px green; } .cftB { margin-right: 10px; border: dashed 5px blue; } .cftC { margin-right: inherit; border: dashed 6px red; } </style> <div class="cftA"> AA 11 <div class="cftB"> BB 22 <div class="cftC">CC 33</div> </div> </div>