我尝试h2
使用伪元素为元素创建边框底部半径。但是当我应用填充时,没有反映边框底部半径的左上角和右上角。但如果我应用保证金,它就会被反映。我不明白为什么会这样
h2:after {
content: "";
width: 10%;
border-bottom: 10px solid rgb(255, 0, 0);
border-radius: 5px 5px 5px 5px;
display: block;
padding-top: 5%;/* ---- top-left and top-right of border were not generated properly */
/*margin-top: 5%; -------this works perfectly*/
}
<div class="main_wrapper">
<h1>Interior Design</h1>
<div id="showcase">
<h2>Showcase</h2>
<div class="category_wrapper">
<div class="row">
<div class="img-width col-md-6">
<img src="img/atrium.jpg" alt="">
</div>
<div class="img-width col-md-6">
<img src="img/kitchenconcrete.jpg" alt="">
</div>
</div>
</div>
</div>
</div>