How to implement custom CSS styling on Wix
Custom CSS can be added to Wix sites through the Advanced Settings panel in the Wix Editor. You can apply global styles via the Custom CSS option or use embedded code elements for specific page styling.
Prerequisites
- Basic understanding of CSS syntax
- Wix Premium plan subscription
- Access to Wix Editor
- Knowledge of HTML structure
Step-by-Step Instructions
Access the Wix Editor Advanced Settings
Open the Custom CSS Panel
Write Your CSS Code
.my-custom-class {
color: #333;
font-size: 18px;
margin: 10px;
}You can target Wix elements by inspecting the page and finding their class names or IDs.
Apply CSS Classes to Elements
Use Embedded Code for Page-Specific Styles
<style> tags:<style>
.page-specific {
background-color: #f0f0f0;
}
</style>Target Wix-Specific Elements
#comp-xxx for specific components or [data-testid="richTextElement"] for text elements. Access these by right-clicking elements and selecting Inspect Element.Preview and Publish Changes
Common Issues & Troubleshooting
Custom CSS not appearing on published site
Ensure you have a Premium Wix plan and that you've clicked Publish after adding CSS. Clear your browser cache and check that CSS selectors are correctly targeting elements.
Styles being overridden by Wix default styles
Use more specific CSS selectors or add !important to your CSS rules. Inspect elements to see which styles are taking precedence and adjust accordingly.
CSS not working on mobile version
Use the Mobile Editor to add mobile-specific CSS or use media queries in your CSS code like @media (max-width: 768px) to ensure responsive design.
Element selectors changing after site edits
Avoid using Wix-generated IDs that start with #comp- as these can change. Instead, add custom CSS classes to elements or use more stable attribute selectors.