Home > Net >  How to select and stylize multiple line before specific character with CSS?
How to select and stylize multiple line before specific character with CSS?

Time:06-25

I have these example line in my html.

<body>
    <ul>
        <li>Name : John</li>
        <li>Age : 32</li>
        <li>Gender : Male</li>
    </ul>
</body>

Is it possible to select & stylize text before colon only and all leave text after colon unaffected with css?

I can't manually insert span of each line because my actual list is way much longer.

Thank you in advance.

CodePudding user response:

You just need to add span, just like this

  • Related