I
I
Igor2015-11-08 10:45:56
css
Igor, 2015-11-08 10:45:56

How to write a text replacement in the .pp2 selector using css?

:after and before are not suitable because they do not remove, but complement the text.
allowable

<div>

bal bla bla

</div>

you need to change the original in the div to hello
using css how?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MK, 2015-11-08
@IgorBee

What if we initially make the div empty, and change the content for :after

.pp2::after{
    content: "bal bla bla";
}
.pp2:hover .pp2::after{
    content: "hello";
}

or create a second one with the desired content and change the display

I
Igor, 2015-11-08
@IgorBee

#slog {
    color: black;
   
    position: relative;
  }
  #slog::after {
    color: #497349;
    content: "профессор";
    
    position: absolute;
  }

As an option, such a design, and your suggestions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question