I try to create the border bottom radius for h2
elements using pseudo elements.
But When I apply padding, top-left and top-right of border-bottom-radius were not reflected. But if I applied margin, it was reflected. I can't understand why this happen
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>