divがfloat: left
あり、その後にフロートをクリアしたい。<div style="clear:both;"></div>
フローティング div の直後に挿入すると、正常に動作します。問題は、追加のない解決策が必要だということですdiv
。
タグに追加clear:both
しましたh2
が、動作しますが、h2 上部マージンは考慮されません。
HTML:
<p class="with_arrow_down">IF you don’t know the cost you are probably making the wrong decisions</p>
<!--<div style="clear:both;"></div>-->
<h2 class="bigmargin">Check list for maintaining the highest levels </h2>
CSS:
.with_arrow_down {
padding-top: 44px;
height: 30px;
width: 28%;
text-align: center;
margin-left: 5%;
float: left;
}
.with_arrow_down:nth-of-type + * {
clear: both;
}
h2.bigmargin {
margin: 65px 0 65px 0;
clear:both;
}
h2マージンを機能させる方法を教えてください。
JSFIddle: http://jsfiddle.net/smdgg/3/