I am trying to create a unique design effect by applying a custom border
to only the last line of text. You can see an example here.
In this scenario, the target text is "2000 years old.
" (with that specific length) and not the entire width of the parent div
which is set at 800px
:
span
{
color: #000000;
display:inline-block;
line-height:20px;
position: relative;
border-bottom: 10px solid red;
padding-bottom: 0px;
text-decoration: none;
font-size:52px;
}
To implement this effect, I have inserted a span
, however, in a real text scenario there might not be any clear delimiter. How would you achieve this using CSS?