Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Selectors Advanced Selectors Pseudo-Elements - ::before and ::after

How would I get two adjacent orange dots?

Pretend that I'm totally bonkers and want to have not just one coral block before the h1 element, but TWO. Is there a way to do this via CSS? I tried h1::before::before, but that didn't work.

Not a pressing matter, just curious.

2 Answers

Jeff Lemay
Jeff Lemay
14,268 Points

You could use :before and :after with absolute positioning.

h1 {
    position:relative;
    padding-left: 20px; /* padding left so we have room for our dots */
}
h1:before {
    content:"\2219";
    position: absolute;
    top: 0;
    left: 0;
    color:coral;
}
h1:after {
    content:"\2219";
    position: absolute;
    top: 0;
    left: 10px;
    color:coral;
}

Something along those lines

Jeff Lemay
Jeff Lemay
14,268 Points

Bullet point is content:"\2219";

Edited answer to reflect.

Something like:

h1::before {
  display: inline-block;
  content: "\B7 \B7";
  font-size: 4em;
  color:coral;
  margin: 0 10px; 
}

will give you circular bullet points of a similar size, but the positioning would still require tweaking.