Juanid Farooq Juanid Farooq - 14 days ago 6
CSS Question

Color the First word of Sentence CSS

I was trying to color just first WORD of sentence

<div class="logoS">Title Of The Page</div>

CSS which am using is

padding: 0px;
float: left;
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
color: white;
border:solid 1px black;
font-weight: bold;
font-size: 22px;

.logoS::nth-word(1) {
margin-right: 20px;

i just want to color "TITLE" not other words, any solution


Try this, hope this will help .

.logoS:before {
  color: red;
  content: "Title ";
<div class="logoS">Of The Page</div>