I give up on this...
.wrapper {
border: 1px solid #aaa;
width: 300px;
height: 300px;
padding: 20px
}
h2 {
border-bottom: 2px solid #ddd;
display: block;
}
h2 span {
border-bottom: 2px solid #f00;
display: inline-block;
margin-bottom: -2px;
}
<div class="wrapper">
<h2><span>TITLE HERE</span></h2>
</div>
Please run the code snippet to see my objective. The length of the RED border is the length of the text title. How can I achieve that without having to add the span or any markup? I tried adding the gray border to pseudo-element ::before but it only doubles up the length of the red border, the gray border should fill the rest of the box. Please help me play with it. thanks!