-1

I was editing a CSS for a page where you have a profile and can't add content. Reinforcement that cannot add content.

So what's my idea, I'm taking page id and adding in css ::before before ::before?

something like that:

HTML I can't change

  <body>

    <div class="alpha">Main div</div>

  </body>

Atual CSS

.alpha::before {
  position: absolute;
  display block;
  width: 100px;
  height: 100px;
  content: "First Before";
  background: #09f;
}

.alpha::after {
  position: absolute;
  display block;
  width: 100px;
  margin-top: 120px;
  margin-left: -58px;
  height: 100px;
  content: "First After";
  background: #09f;
}

Goal CSS

.alpha::before::before {
  position: absolute;
  display block;
  margin-top: 240px;
  width: 100px;
  height: 100px;
  content: "Second Before";
  background: #09f;
}

photo of how it is and how I'm trying to change it... As requested. enter image description here enter image description here

And this is the code running

.alpha::before {
  position: absolute;
  display block;
  width: 100px;
  height: 100px;
  content: "First Before";
  background: #09f;
}

.alpha::after {
  position: absolute;
  display block;
  width: 100px;
  margin-top: 120px;
  margin-left: -58px;
  height: 100px;
  content: "First After";
  background: #09f;
}

.alpha::before::before {
  position: absolute;
  display block;
  margin-top: 240px;
  width: 100px;
  height: 100px;
  content: "First Before";
  background: #09f;
}
<div class="alpha">Main div</div>

Can the post be reopened? my doubt was not answered and I still have to choose a correct answer since there was a divergence between answers

1 Answers1

2

That's not allowed, you can only have two pseudo elements on one HTML element, :before and :after. For more information visit.

Nexo
  • 2,125
  • 2
  • 10
  • 20
Jovana
  • 557
  • 1
  • 5
  • 20
  • I've already used an ``after`` and a ``before``... The problem is this, that I'm running out of id to add these two elements. – WEB Last Wolf Oct 05 '22 at 20:19
  • 1
    Please add code and scrinshot of what you're trying to accomplish using pseudo elements and explain where you use them. – Jovana Oct 05 '22 at 20:21