Title: Javascript in Text Widget &#8211; Use CSS from Code, Not  From Theme
Last modified: August 21, 2016

---

# Javascript in Text Widget – Use CSS from Code, Not From Theme

 *  [cridge](https://wordpress.org/support/users/cridge/)
 * (@cridge)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-in-text-widget-use-css-from-code-not-from-mytheme/)
 * I added this plugin to my Multisite installation which worked great in allowing
   me to add javascript to text widgets: [http://wordpress.org/plugins/allow-javascript-in-text-widgets/](http://wordpress.org/plugins/allow-javascript-in-text-widgets/)
 * The problem I’m having now is, the widgets are displaying with my theme’s CSS
   instead of the CSS defined in javascript code. Is there some code I can add that
   will allow me to control the CSS hierarchy or tell it to ignore the theme’s styling?
 * 2 Examples:
    **Styling of widgets when added to my website**: [http://cridge-553.sites.z57.com/category/real-estate-news](http://cridge-553.sites.z57.com/category/real-estate-news)
 * **Native styling of Weather Widget**: [http://www.weather.com/services/oap/weather-widgets-congrats.html?from=weatherwidget_GetCode&location=USGA0028&template=GENX&align=V&par=3000000007&unit=0&key=twciweatherwidget](http://www.weather.com/services/oap/weather-widgets-congrats.html?from=weatherwidget_GetCode&location=USGA0028&template=GENX&align=V&par=3000000007&unit=0&key=twciweatherwidget)
 *     ```
       <script type="text/javascript" src="http://voap.weather.com/weather/oap/USGA0028?template=GENXV&par=3000000007&unit=0&key=twciweatherwidget"></script>
       ```
   
 * **Native styling of Mortgage Calculator Widget**:
    [http://www.bankrate.com/free-content/mortgage/calculators/free-mortgage-calculator/](http://www.bankrate.com/free-content/mortgage/calculators/free-mortgage-calculator/)
 *     ```
       <link rel="stylesheet" href="http://www.bankrate.com/free-content/css/bankrate-fcc-calculators.css" type="text/css"/><div id="mrtgCalheaderDiv" class="BankrateFCC_boxhead-container-small"><div id="mrtgCaltitleDiv" class="BankrateFCC_boxhead">Mortgage Calculator</div><a href="http://www.bankrate.com/free-content/mortgage/calculators/free-mortgage-calculator/"><img id="mrtCalBrLogo" src="http://www.bankrate.com/images/free-content/widget-logo.gif" border="0" align="right" width="116" height="23" alt="Free mortgage calculator by Bankrate.com"></a></div><input id="mrtgCal" type ="text" value="1,Arial,275" style="display:none" /><script language="Javascript" src="http://js.bankrate.com/free-calculators/free-simple-mortgage-calculator-widget.js" type="text/javascript"></script><div id="mrtgCalfooterDiv" class="BankrateFCC_footer-container small">Use this <a href="http://www.bankrate.com/calculators/mortgages/mortgage-calculator.aspx" title="Mortgage calculator by Bankrate.com">mortgage calculator </a>to find loan payment.</div><script type="text/javascript"> mrtgCalcinit();</script>
       ```
   
 * Any help is greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [12 years, 10 months ago](https://wordpress.org/support/topic/javascript-in-text-widget-use-css-from-code-not-from-mytheme/#post-3925514)
 * You probably need to add the CSS to your themes, or have it set as a higher importance.
 * This doesn’t sound like a Multisite bug, though, and just a normal one.
 *  Thread Starter [cridge](https://wordpress.org/support/users/cridge/)
 * (@cridge)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-in-text-widget-use-css-from-code-not-from-mytheme/#post-3925589)
 * Thank for the response but that doesn’t work for my purposes. I’d like to find
   a solution that allows me to set the CSS hierarchy within the text widget. In
   our multisite environment, we don’t give clients access to the theme files so
   the text widget is the only place they can control the code.
 * Any other suggestions?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-in-text-widget-use-css-from-code-not-from-mytheme/#post-3925590)
 * Use a plugin like Jetpack, which has a CSS editor, so clients CAN edit CSS 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Javascript in Text Widget – Use CSS from Code, Not From Theme’ is closed
to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [text widget](https://wordpress.org/support/topic-tag/text-widget/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 3 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-in-text-widget-use-css-from-code-not-from-mytheme/#post-3925590)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
