html - Overlap Text on Border without using any extra elements -
on below code, want border should stay on side of text. text needs overlapping border.
the issue is, not allowed add html elements spans or else h1 tag added users doesn't have knowledge of html tags.
h1{ position:relative; display:inline-block; z-index:10; } h1::after{ content:""; display:block; position:absolute; left:0px; bottom:5px; height:10px; width:100%; background-color:yellow; z-index:0; } <h1>this title</h1>
use z-index:-1 on border(:after) , go
h1{ position:relative; display:inline-block; z-index:10; } h1::after{ content:""; display:block; position:absolute; left:0px; bottom:5px; height:10px; width:100%; background-color:yellow; z-index:-1; } <h1>this title</h1>
Comments
Post a Comment