Noa
Noa

Reputation: 1216

Can I add styling to pseudo-elements?

I want to add a styled button via pseudo-elements in CSS.

.class:before{
  content: "button with design";
  /* ... */
}

Is there any way to achieve this?

Upvotes: 0

Views: 56

Answers (1)

bpardo
bpardo

Reputation: 411

To add an image to :before you can do this:

.class:before{
    content: url(image.jpg);
}

Upvotes: 1

Related Questions