26

I am new at wix and editing a website and want to add css in a page. but not found any option for css. Anybody know how to add custom css code in wix website?

Thanks

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
Ravi Singh
  • 437
  • 1
  • 5
  • 11
  • You may want to adjust your tags to include `wixcode` because `wix` is Windows Installer XML and not related. – vre Apr 17 '18 at 12:27
  • 5
    @Paulie_D — The question isn't asking for any of those. It is a simple "How can I achieve X using this tool?" question. – Quentin Apr 17 '18 at 15:38
  • @Quentin Meh! : ) It was that or another reason. this one seemed the most appropriate. – Paulie_D Apr 17 '18 at 15:41
  • I've successfully used the method described by [Gray](https://stackoverflow.com/questions/49877549/how-to-add-custom-css-in-wix-website/54226844#answer-51219109). Please note that you can only use "Tracking & Analytics" with a paid account. I also found that adding anything to the "Head" will just stick it anywhere in the head-tag. In fact, Wix will place it above most style and script links so it's practically useless to add CSS here. I found that for CSS, "Body - Start" works best and for Javascript, "Body - End" works best. – Daniel Gurtner Jan 16 '19 at 23:19
  • This is not a valid question. Please explain more – Chanaka De Silva Feb 24 '19 at 05:55

10 Answers10

39

You can do this by embedding inline styles to every page, via creating a chunk of custom css code contained between <style> and </style>.

  1. Go to your site's dashboard.
  2. Click Manage Website on the left.
  3. Click Tracking & Analytics.
  4. Click + New Tool **and select **Custom from the dropdown.
  5. Set up your custom code:
    1. Enter your custom code.
    2. Select the relevant domain. Note: This option will appear only if you have multiple domains.
    3. Enter a name for your custom code.
    4. Add Code to Pages: Select which pages to add your code to:
      • **All Pages: **Click the dropdown to select an option:
        • Load code once.
        • Load code on each new page.
      • **Choose specific pages: **Begin typing the name of the relevant pages and then click the checkbox next to the relevant page.
    5. Place Code in: Select where the code snippet in placed in your site's code:
      • Head - as noted by @Daniel Gurtner, avoid this because it'll insert it BEFORE any of the inherent styles, which makes it mostly useless here.
      • Body - start
      • Body - end Note: I'd recommend adding your style chunk here to avoid having a delay effect on your loading
  6. Click Apply.
rinogo
  • 8,491
  • 12
  • 61
  • 102
Gray Ayer
  • 997
  • 1
  • 9
  • 17
9

Wix keeps on updating this but I have found where the place described in the most voted comment is for now. I don't have enough "reputation" to add a comment to the thread, hence why this is an answer.

Go to Settings and scroll to Advanced(the last section) and you can see Custom Code. The rest of the steps are the same.

7

As of 2022, you can add it from your Wix Dashboard under Settings > Advanced > Custom code.

Click the Add Custom Code button. Enter your CSS in the Paste the code snippet here: textarea. Make sure to wrap it within <style type="text/css"></style> tags. Set the Code Type as "Essential" as it doesn't require user consent to load.

Note: You won't be able to see your CSS from the page editor nor Preview mode. You have to Publish it and view it from the frontend.

Wix Add Custom Code screenshot

2
  1. Click Add on the left in the editor.
  2. Click More → Embeds.
  3. Drag the HTML iframe to the site.
  4. Click your iframe and click Edit Code.
  5. Then type:

    <style>
     /* CSS Code */
    </style>
    
double-beep
  • 5,031
  • 17
  • 33
  • 41
Garry
  • 49
  • 6
1

Follow these steps to add CSS in Wix.

  1. Go to your site’s dashboard.
  2. Click Manage Website on the left.
  3. Click Tracking & Analytics.
  4. Click + New Tool **and select **Custom from the dropdown.
  5. Set up your custom code:
  6. Enter your custom code.
  7. Select the relevant domain. Note: This option will appear only if you have multiple domains.
  8. Enter a name for your custom code.
  9. Add Code to Pages: Select which pages to add your code to:

If you need more help with Wix Web Development visit wix.com/forum.

Evalyn Roy
  • 11
  • 1
1

I just tried it on 6th Sep 2021. Yes it is possible to add CSS & JS custom code.

At the same place of writing custom HTML code

For CSS code add,

<style type:"text/css"> CSS CODE HERE </style>

For JS Javascript code add,

<script> JS CODE HERE </script>
lejlun
  • 4,140
  • 2
  • 15
  • 31
Lalababa
  • 11
  • 1
0

The steps in previous answers did not work for me. It seems the interface has changed.

The following steps work with the new UI:

  1. Go to your site's dashboard
  2. Click settings in the left sidebar
  3. scroll down to the "Advanced" section
  4. Click "Custom Code"
crazy_abdul
  • 503
  • 6
  • 12
0

All carriage returns within the embedded code will show up as \n on the output, rendering the code non-functional.

P R
  • 1
-1

You could also achieve this by setting the .html property of your object (#id) in Velo.

The following example adds a drop shadow to your object with id equal to #id:

$w("#id").html = "<p style='filter: drop-shadow(1px 8px 4px #4444dd)'>test</p>"

Below snippet shows the result in pure HTML.

<p style='filter: drop-shadow(1px 8px 4px #4444dd)'>test</p>
user1098973
  • 334
  • 2
  • 9
-5

You can't. This is not a feature provided by Wix.

ref. other ref.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335