i'm trying to underline my text with an additional arrow centered on the ligne. when doing this i can't center my text in the page.
.souligne {
line-height: 17px;
padding-bottom: 15px;
text-transform: uppercase;
border-bottom: 2px solid #00a7a8;
position: relative;
display: inline-block;
}
.souligne:before {
content: '\25bc';
position: absolute;
top: 100%;
left: 5em;
color: #00a7a8;
}
<h2 class="souligne" style="text-align:center;">THIS IS MY HEADER</h2>
The text is not centered when doing this.
.souligne {
line-height: 17px;
padding-bottom: 15px;
text-transform: uppercase;
border-bottom: 2px solid #00a7a8;
position: relative;
display: inline-block;
}
.souligne:before {
content: '\25bc';
position: absolute;
top: 100%;
left: 5em;
color: #00a7a8;
}
<h2 class="souligne" style="text-align:center">THIS IS MY HEADER</h2>
<br>
<center><h2 class="souligne">THIS IS MY HEADER</h2></center>
so when using style="text-align:center"
in H2 it doesn't center the text, it works only when using <center>
.