Alex Rivera | Logout

JQuery UI Tabs - How to prevent styles being applied to content within tabs?

Asked 2010-09-21T05:27:19.033
28

I have implemented the JQuery UI tabs and they work great, except for one problem...

All my content's styles / classes are being overriden by JQuery's, which I do not want to happen.For example, I have a text box:

<input type="text" id="profileFirstName" name="profileFirstName" class="textMedium" />

If I inspect the styles in Firebug, I see this (in this order):

.ui-widget :active {
outline:medium none;
}

.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
font-family:Verdana,Arial,sans-serif;
font-size:1em;
}

input.textMedium {
width:200px;
}

As you can see, JQuery has added the ui-widget styles before my own, thus overriding mine.

It is doing this everywhere I have implemented the tabs. How do I set it GLOBALLY so that its styles don't override mine?? I do not want any of the jquery styles affecting the tabbed content.

I suppose I could override their ui-widget styles and put nothing under the definitions? But I would like to know if there is a cleaner way so that their ui-widget styles don't get applied at all.

Thanks in advance!

Edit
Report

1 Answer

3

I know its one year later but I found out that this section of the UI.css file was the primary culprit of style propagation:

/* Component containers
----------------------------------*/
.ui-widget { /*font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; */}
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {/* font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em;*/ }
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
.ui-widget-content a { color: #333333; }
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
.ui-widget-header a { color: #ffffff; }

Commenting it out will solve most of the problems (well, until you update the UI again).

answered 2011-09-07T18:41:15.973

Your Answer