0

I'm using two jquery ui widgets, autocomplete and tabs.

They each have their own stylesheets in jquery.ui.autocomplete.css and jquery.ui.tabs.css respectively, however they share a lot of styles in jquery.ui.theme.css. When I make a change to the styles in jquery.ui.theme.css it affects both the autocomplete and the tabs. How can I customize the styles different for autocomplete and tabs?

One thing I would like to change is the rounded edges on the background hover effect for the autocomplete. The proper .css change to this is

.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 0px; -webkit-border-top-left-radius: 0px; -khtml-border-top-left-radius: 0px; border-top-left-radius: 0px; }

However I would like the tabs to be rounded. So the change I would make is change the radius from 0px to 5px.

1
  • just put style='' into the tags, that will overwrite anything Commented Feb 26, 2012 at 12:44

1 Answer 1

1

Put style which you want to customize, for example at head section like below:

#my-tab .ui-corner-all, #my-tab .ui-corner-top, #my-tab .ui-corner-left, #my-tab .ui-corner-tl { -moz-border-radius-topleft: 0px; -webkit-border-top-left-radius: 0px; -khtml-border-top-left-radius: 0px; border-top-left-radius: 0px; }

my-tab being your jquery-ui tab div id

edit:

from jquery ui tabs documentation

Your rendred html will look like:

<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
   <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
     <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Nunc tincidunt</a></li>
      <li class="ui-state-default ui-corner-top"><a href="#tabs-2">Proin dolor</a></li>
   <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="tabs-1">
      <p>Tab one content goes here.</p>
   </div>
    ...
</div>

for "menu", you will override by:

#ui-tabs .ui-tabs-nav>li a { color: red !important } 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, do you have any tips for how to customize the autocomplete menu in the same way you suggested for tabs? The autocomplete menu does not have an id attribute and the menu is dynamically generated, so I'm having some difficulty there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.