top of page

How to Add Custom CSS to Wix Studio

Writer: Faysal Jaali
Faysal Jaali
Jul 18, 2024
6 min read

Updated: Nov 2

To add custom CSS in Wix Studio, define styles in global.css and apply a custom class to a supported element. Start with one small change so you can see which element it affects before extending it across the site.


This workflow is for the Studio Editor. Wix documents the available styling features in About CSS Editing.


illustration about how to add css to Wix Studio

1. Identify the element and the change


Choose a concrete requirement, such as a border around service cards or a different hover treatment. Check whether the editor already provides the setting before adding CSS.


For this example, the requirement is simple: give selected service-card containers a border, rounded corners and a subtle shadow. The class should affect only those cards.


2. Open global.css


In the Studio editor’s Page Code area, open the CSS section and add or open global.css. Wix’s CSS styling documentation explains that styles in this file apply to selected classes throughout the site.


The file is shared styling, so a rule aimed at a broad class can affect more pages than the one currently visible. Use a custom class when you want to limit the change.


screenshot on where to add css on Wix Studio
Original Wix Studio screenshot showing the CSS area and global.css.

3. Assign a custom class


Select the supported container and use its CSS classes controls to assign the custom class cm-service-card. The class name is entered without the leading dot; the CSS selector uses the dot.


Wix distinguishes custom classes from the semantic classes exposed by supported elements. Target the part that actually owns the property you want to change rather than assuming every visual property belongs on the root.


Wix Studio Editor Screenshot, CSS Classes
Original Wix Studio screenshot showing custom CSS classes.

4. Add a small CSS rule


Add this illustrative rule to global.css:


.cm-service-card {
  border: 1px solid rgb(213, 218, 227);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

The rule contains no fixed width or height, so the editor can continue controlling the card’s layout. Adjust the colours and dimensions to your design, then apply the class to another card only after the first behaves as intended.


This is a styling example, not a complete component. Text, links, spacing and responsive layout still need to be reviewed in context.


5. Check the result on the published website


Preview the change and inspect the card on a narrow phone layout and a wide desktop layout. Check whether borders are clipped, shadows overlap nearby content or a shared class changed an unintended element.


Then publish and repeat the relevant checks on the live page. Preview alone does not test every aspect of the customer’s actual journey.


Why is the CSS not applying?


Work through one variable at a time:


  • Confirm that the element supports the styling feature.

  • Match the class spelling exactly.

  • Confirm that the class was assigned to the intended element.

  • Check whether another rule targets the same property.

  • Review the element’s semantic classes if you need to style an internal part.

  • Temporarily simplify the rule to make the effect obvious.


Avoid adding repeated overrides before you understand the conflict. A short, well-scoped rule is easier to maintain.


Keep the styling maintainable


Use a consistent class prefix, group related rules and leave a short comment explaining non-obvious decisions. Keep a record of which pages use a class.


Do not remove visible keyboard focus to make a control look cleaner. When changes affect interactions, include keyboard and mobile checks in the review. The AODA website guide explains why a visual check alone is insufficient.


Understand the selector before changing a rule


A CSS selector identifies the elements a rule can affect. A class selector starts with a dot, such as .service-card. In Wix Studio, assign the corresponding custom class to the intended element and put the rule in global.css. An element’s Velo ID and its CSS class serve different purposes; changing one does not automatically create the other.


Scope a class to the design role it describes. A name such as service-card is easier to maintain than blue-box-3 when the design later changes color. Reuse it when several elements should share the same styling, and create a separate class when the behavior needs to differ.


The Wix CSS editing guide documents global and custom classes, the global.css panel and supported elements. Check the supported classes for the specific element before targeting an internal label or icon. Do not depend on generated browser markup whose class names you do not control.


Screenshot how add css to Wix Studio
Original illustration of connecting a class with a rule in the CSS editor.

Add a small visual rule first


For an element that supports the relevant properties, start with a simple rule so you can confirm the custom class is connected correctly. Assign service-card to the intended container, then add this example to global.css:


.service-card {
  border: 1px solid #d8dee8;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgb(20 35 60 / 8%);
}

@media (max-width: 600px) {
  .service-card {
    border-radius: 12px;
  }
}

This example changes appearance, not the site’s content structure or the way a form submits. Confirm each property on the chosen element. Use the Studio layout controls for the component’s main sizing and arrangement unless a specific requirement calls for custom layout CSS.


Keep the test small. If the border appears but another property does not, investigate that property and the targeted element. Replacing the entire stylesheet makes it harder to identify what actually changed.


Use the original design examples as visual references


The restored screenshots show the original tutorial’s CSS panel, class assignment and navigation experiments. They illustrate the relationship between an editor setting, a rule and a visible result. The exact appearance depends on the element, its existing styles and the rest of the page.


When adapting a navigation effect, test keyboard focus as well as hover. A mouse-only effect can hide an important state from keyboard users. Keep the selected page understandable without relying only on a color change, and check that the touch layout still exposes the required actions.


Avoid adding animation just because it is possible. A small transition may help communicate an interaction, while continuous movement can make text harder to read. Use the simplest effect that supports the task and assess any motion settings used in the design.


Example 1 - CSS  - before
Original design example before the custom styling was applied.

Example 1 - CSS  - after
Original design example after custom styling; a visual illustration rather than a result guaranteed by every snippet.

Mid level Example screenshot - Css
Original navigation styling example from the CSS tutorial.

Complex example result - css
Original navigation design example. Check hover, focus and mobile behavior when implementing a similar effect.

Diagnose a rule that seems to be ignored


First confirm the class spelling and the element it is assigned to. Then check whether the rule is saved, whether a media query currently applies and whether another declaration is taking precedence. Test the published page as well as the editor preview.


If a broad selector changes too much, remove or narrow that rule before adding more overrides. Repeated !important declarations can make the styling difficult to reason about. Keep the original editor styling and the custom rule together in your investigation so you can identify which layer controls the result.


For a responsive problem, test widths between the named breakpoints. Long text, translated text and a different browser zoom can expose a layout problem that a single desktop screenshot misses. Check adjacent elements after changing borders, shadows or spacing.


Leave a useful record for the next editor


Group related rules and add a short comment explaining any non-obvious requirement. Keep a list of the custom classes used in shared components. Before deleting a class, check the other pages that use it.


For a larger change, save the previous rule and describe how to verify the new one. A useful check might be “the service cards have equal spacing on the service page and remain readable at phone width.” That is more actionable than “CSS looks better.”


Is custom CSS the same as changing an element ID?


No. A CSS class is a styling selector. An element’s Velo ID has a different purpose in page code.


Should every design change use CSS?


Use the simplest supported approach that meets the requirement and remains understandable to future editors.


For help with a Studio styling or functionality issue, contact CodeMasters with the affected page and the behaviour you want.

bottom of page