Before/After text change in only one instance of use

Hi,

I am using the Before/After shortcode in several places on my site and it's great! However, in one of the isntances, using Before/After doesn't make sense, so I would like to change that one instance of the hover text. I have located the CSS that controls the Before/After text content, but I'm having a terrible time just targeting the one instance that I need to change.

Can you please help me target this text and create the new instance? I have tried adding a class to the .twentytwenty-before-label::before css rule, but so far nothing that I have tried has worked. Everything I've done has made the change globally or been completely ignored.

I've tried .twentytwenty-before-label .marketing:: before...

.twentytwenty-before-label>marketing::before...

.twentytwenty-before-label.marketing::before...

and a few other options.

I would greatly appreciate a bit of help with this.


Thanks so much!

Comments

  • Hi,

    Please always attach a link to your website so we can check it out. If the page is offline(localhost), then our help will be limited. You will have to contact us when the page is online. Also, please make sure that the page is not under maintenance before you provide us the link.

    It is always a good idea to also attach a screenshot showing what you want to change and achieve.

    Thanks

  • I just need to change the word Before and the word After in the hover text on the Before/After shortcode. I have currently set it to not show any words by putting a blank in the CSS code.

    .twentytwenty-before-label::before {

      content: "";

    }

    .twentytwenty-after-label::before {

      content: "";

    }

    We are not quite sure exactly what we want to change the text to, but it can't say Before and After when hovered. I figured out how to change the text for all of the instances of the Before/After shortcode, but now I need to customize only one instance of that shortcode. All of the other instances of the Before/After shortcode still need to say Before/After. I also found the shortcode code in the php files, but I am unsure if duplicating that and editing it will work in conjunction with CSS changes. Please point me in the right direction.

    Here's a link to the page: https://www.s-g-marine.com/media-campaign, and the Before/After in question.


    Thanks for your help.

  • To do that, you can add a class to this particular Before After item, and wrote a special CSS for this class.

    Check the following screenshot for a better understanding

    .noBefAft .twentytwenty-before-label::before,
    .noBefAft .twentytwenty-after-label::before {
     content: ""!important;
    }
    

    Thanks

  • Thank you so much! This is perfect!!! I was super close to getting it right on my own. I basically only needed to switch the special class to in front of the .twentytwenty.... and add the !important at the end. Otherwise I had it right.

    Thanks for the awesome support! My client will be SO happy.

  • I am glad that I could help, and thanks for your kind words.

    If I can help you with anything else, please, let me know.


    Thanks

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.