What are you trying to achieve:
I want to apply custom CSS on website
What have you already tried:
I have already created a file global.css and I am writing CSS on that but that CSS not showing on frontend and also you can say it is not working.
Additional information:
The following CSS I have applied
iframe.wuksD5 {
Certain elements are not supported in Wix Studio CSS. Like iframe, some app widgets, etc. Make sure your elementnsupports CSS. Also, check if wix actually supports the CSS format
You can write the CSS for simple text, iframe.wuksD5 targets text inside the iframe. Wix Studio doesn’t support iframe elements yet. Use the CSS directly for text.
When you have your text element selected, look in the code section ‘CSS Classes’ tab. You will see any ‘Global’ classes that are available for the selected element. Or you will see an area where you can type in your own ‘Custom Class’ so you can target just the specific element and not all similar elements as well.
So for a standard rich text element, the global classes are: ‘rich-text’ and ‘rich-text__text’. But if you add a style for either of these, the style will apply to ALL rich text boxes across your whole site. So this is where adding your own ‘Custom Class’ might be helpful if this is not what you are hoping to achieve.
When you stated that you added a rule targeting ‘iframe.wuksD5’, this would not work on standard text as the selector is an iframe. So you would want to change the selector to something like ‘.rich-text__text’ if you want to affect a rich text box element.
Hello there. I am having a similar problem, exclusively with custom classes. I have a paragraph html element with custom class = “content”, but when I add in global.css .content {color: green} as I would tipically do on a CSS when adding class="content" inside the html tag, the text doesn’t change in style. Only global classes work such as rich-text__text.
Is there a reason for this or have I missed something? I have tried on free and premium websites, no difference.
Sorry, a little clarification on rich text boxes. The Custom Class you can add is applied to the rich text CONTAINER, not the actual paragraph text inside. This is the same as what is targeted globally with ‘.rich-text’. So styling added to this is typically overridden by the styles added directly to the text (e.g,. what you would set in the editor) due to specificity. Wix only gives you access to certain elements in the chain, not all unfortunately.
To target the inner text, you would either use ‘.rich-text__text’ as you discovered for global changes, or you would use: ‘.your-custom-class .rich-text__text’ to target the text inside the element with your custom class added.