Optimizely changes style of other elements
So i'm testing the main message in my hero image (my H1) but the style changes effect other H1s on my site.
I'm pretty sure that shouldn't do that.
Is there a way to make sure it only effects the item I wanted to change?
Do you use experiment CSS to alter the CSS or you insert it via jquery only for the variation? Also, what's the experiment targeting settings - maybe you've added the global CSS and your experiment is using RegEx to target more pages across the website (or the whole website).
I'm not using experiment CSS. I just change the text using the 'change text' feature and moved it a bit using the 'more and arrange' feature.
I also removed 2 form fields.
I don't think I use jquery. I've just implemented the JS code and started playing around in the WYSIWYG editor.
I didn't add a global CSS and I am not using Regex. I'm just a'b testing the homepage.
What @himynameisivo is reffering to involving jQuery is the experiment variation code. This article explains where to find your experiment's variation code. Each time you make a change using the Visual Editor, a corresponding line of jQuery is added there. This jQuery will be run on all pages where the experiment is targeted.
To make sure your variation code only changes the one headline you're testing, you'll want to make sure the jQuery selector used in the variation code is specific to only that headline. This support article contains a non-technical explanation of how jQuery selectors work if you're not already familiar. You can make your selector more specific by adding a class or id name.
Hope this helps!
Sr. Technical Support Engineer
Optimizely | EMEA