April 20, 2021

Software Mile.com

Latest Software News and Hacks

Using :before and :after pseudo-elements with images

I’m wondering how you format the Content CSS in a ::after pseudo-element?

I’m trying to have an h1 heading that has small images to the left and right of it.

My code so far:

HTML:

<h1>This Week's Photo Features</h1>

CSS:

h1 {
  text-align: center;
}

h1:before {
  content: ("images/NikonD100_40x30.jpg");
}


Go to Source of this post
Author Of this post: SkyjumperTalon
Title Of post: Using :before and :after pseudo-elements with images
Author Link: {authorlink}