Issue
I want to add a background colour only at the centre part of a text? Like a thick strikethrough but only in the background.
I was very close but I couldn't do it. Please help I'm a beginner! Thank You!
Below is my code:
.home-section-title {
font-family: 'Alegreya Sans SC', sans-serif !important;
font-weight: 300 !important;
letter-spacing: 9px !important;
font-size: 36px !important;
color: #000000 !important;
background-color: #FFF5F3;
text-align: center;
}
<h3 class=home-section-title>FLASH SALE</h3>
Solution
You may use a gradient (repeating if it is to be layed through a few lines) .
possible example (here using em for the demo ) :
body{
font-size:36px;/* demo purpose */
}
.home-section-title {
font-family: 'Alegreya Sans SC', sans-serif !important;
font-weight: normal;
letter-spacing: 0.25em;
color: #000000;
background:repeating-linear-gradient(to bottom,transparent 0 0.35em ,#FFF5F3 0.35em 0.85em, transparent 0.85em 1.2em);
text-align: center;
}
<h1 class=home-section-title>FLASH SALE</h1>
<h1 class=home-section-title>FLASH <br> SALE</h1>
<h2 class=home-section-title>FLASH SALE</h2>
<h2 class=home-section-title>FLASH <br> SALE</h2>
<h3 class=home-section-title>FLASH SALE</h3>
<h3 class=home-section-title>FLASH <br> SALE</h3>
Answered By - G-Cyrillus
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.