0

I looked at this question, but it didn't work for me.

Here is a picture of the situation: enter image description here

I want to replace the text "Select subscription plan" with "All plans comes with a 7-day free trial." And I almost accomplished this using the following CSS:

.discourse-subscriptions-section-columns .section-column div > p:after {
content: "All plans come with a 7-day free trial!"; }

But then original text still remains, and if I use

.discourse-subscriptions-section-columns .section-column div > p {
visibility: hidden; }

then EVERYTHING disappears, not just the "Select subscription plan" part. Hence, I am not sure what to do to get this to work...

Wesley
  • 1,217
  • 3
  • 12
  • 16

1 Answers1

2

You need to make sure the font-size of the parent is 0px so the :after can replace it. This will avoid using absolute positioning and make the text naturally fit in.

p{
    font-size: 0px;
    visibility: hidden;
}

p:after{
    content: "All plans come with a 7-day free trial!";
    position: relative;
    visibility: visible;
    font-size: 20px;
}
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quia, optio?</p>
Diego Fortes
  • 8,830
  • 3
  • 32
  • 42
  • Nice! This works... Mostly at least. It replaces the text, but now there is barely a gap between this text and the buttons, so it looks kind of weird. How can I get the correct spacing back, to where there is a one-line gap between the

    and the buttons?

    – Wesley Mar 01 '21 at 02:49
  • It's difficult to guide you without taking a look at it. Can you share the website link? – Diego Fortes Mar 01 '21 at 07:13