0

I noticed in the jquery.ui.theme.css file the following class after removing the comments...

 .ui-widget-header {
                  border: 1px solid #aaaaaa;
                  background: #cccccc;
                  color: #222222;
                 font-weight: bold;
                   }

Now I noticed this class name:

      .ui-widget-header .ui-state-default {
               border: 1px solid #d3d3d3;
               background: #e6e6e6;
               font-weight: normal;
               color: #555555;
                  }

How would .ui-widget-header .ui-state-default be implemented? Would the ui-state-default override the ui-widget-header if they both are implemented?

2 Answers 2

1

.ui-widget-header .ui-state-default rule targets the elements with class ui-state-default inside the elements with class ui-widget-header. If you implement these two classes on same element:

<div class="ui-widget-header ui-state-default"></div>

You will only see the effect of the rule .ui-widget-header on the div. However, in case you have markup like this:

<div class="ui-widget-header">
   <div class="ui-widget-header ui-state-default"></div>
</div>

You will see the effect of the second rule on inner div: the first one will be overridden.

Sign up to request clarification or add additional context in comments.

Comments

0

According to jquery.com

.ui-widget-header: Class to be applied to header containers. Applies header container styles to an element and its child text, links, and icons.

.ui-state-default: Class to be applied to clickable button-like elements. Applies "clickable default" container styles to an element and its child text, links, and icons.

So

.ui-widget-header .ui-state-default {
               border: 1px solid #d3d3d3;
               background: #e6e6e6;
               font-weight: normal;
               color: #555555;
                  }

applies to an clickable button-like element with the class .ui-state-default inside an header container with the class .ui-widget-header.

Comments

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.