Reputation: 75
I want to highlight the first letter of a group of words, which begin with the same letter and are separated with a break line
Here is what I want to achieve
I tried this code, and the other words seem to go under the first letter
p::first-letter {
font-size: 40px;
font-weight:800;
}
p span::before{
content: "\a";
white-space: pre;
}
<p>Youthful<span>oungish</span></p>
Any idea how to achieve this ? Thank you
Upvotes: 2
Views: 160
Reputation: 4449
Can you please check the below code? Hope it will work for you. Using flex property we can design this type of structure.
Please refer to this link: https://jsfiddle.net/yudizsolutions/xzub1Lq4/6/
.title {
display: flex;
display: -webkit-flex;
align-items: center;
-webkit-align-items: center;
}
.title .main-character {
margin-right: 10px;
font-size: 50px;
line-height: 50px;
font-weight: 800;
}
.title p {
margin: 0;
}
<div class="title">
<p class="main-character">Y</p>
<div>
<p>outhful</p>
<p>oungish</p>
</div>
</div>
Upvotes: 2