Skip to main content

I know this is an old question but I would like to update the answer to CSS3. The question is a pseudo-class or a pseudo-element.

CSS2 way (pseudo-class)

.OwnerJoe:before {
  content: "Joe's Task:";
} 
    .OwnerJoe:before {
      content: "Joe's Task:";
    } 

CSS3 way (pseudo-element) Note the double colon

.OwnerJoe::before {
  content: "Joe's Task:";
}
    .OwnerJoe::before {
      content: "Joe's Task:";
    }

I know this is an old question but I would like to update the answer to CSS3. The question is a pseudo-class or a pseudo-element.

CSS2 way (pseudo-class)

.OwnerJoe:before {
  content: "Joe's Task:";
} 

CSS3 way (pseudo-element) Note the double colon

.OwnerJoe::before {
  content: "Joe's Task:";
}

I know this is an old question but I would like to update the answer to CSS3. The question is a pseudo-class or a pseudo-element.

CSS2 way (pseudo-class)

    .OwnerJoe:before {
      content: "Joe's Task:";
    } 

CSS3 way (pseudo-element) Note the double colon

    .OwnerJoe::before {
      content: "Joe's Task:";
    }
Source Link
Joe Johnston
  • 2.9k
  • 2
  • 32
  • 57

I know this is an old question but I would like to update the answer to CSS3. The question is a pseudo-class or a pseudo-element.

CSS2 way (pseudo-class)

.OwnerJoe:before {
  content: "Joe's Task:";
} 

CSS3 way (pseudo-element) Note the double colon

.OwnerJoe::before {
  content: "Joe's Task:";
}