How do I create a CSS class Union?


Tags: css,stylesheet,union

Problem :

I have a div that unions CSS classes as such:

    <div id="tp" class="ui-hidden-on-load ui-tablepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible">
        ...
    </div>

How do I create a CSS style that I can combine all of these classes together into a single class with a discreet name?

example:

<div class="myCustomClass">
...
<div>

Where my custom class is an intersection of all of the combined classes? I can't seem to find an example or good explanation of how this is done.

Thanks in advance for reading my question!



Solution :

AFAIK that's not possible in CSS. You can either feed rules to multiple selectors:

.one, .two, .three { color:red; }

Or manually add a generic class to every HTML element.

If you want to target elements that have certain classes you can do .one.two.three {}


    CSS Howto..

    How to fixed image on every screen resolution?

    How to have vertical record and header in HTML table using CSS

    how to dynamically remove css in Angular?

    How to set padding on the container?

    How to get the Apple Javascript Split Flap Counter to run on pure CSS

    How to use jQuery to find a certain string within a div, and then apply specific styles to another div if it exists? [closed]

    How do I apply CSS to the table generated into another window?

    Showing an hidden element with an opacity-animation

    How to remove dotted border around active hyperlinks in IE8 with CSS

    Show/hide without using CSS

    How can I get the body to continue look the same when a div inside overflows to the right?

    How to use inline CSS by th:style using “The ? : operator” in ThymeLeaf

    How to make the page layout stay the same after minimized?

    How do I add CSS styles to an ASP.NET UserControl from the code-behind?

    AngularJS ng-show animation cross-fade inside ng-repeat

    Test if is visible with ng-show attribute

    How To Center A CSS Drop Down Menu [closed]

    CSS: How does youtube change its appearance based on screen size?

    How do I get this CSS text-decoration override to work?

    How can I use JQ to pick out a parent whose child is hr.strong?

    How to get rid of an automatically generated span via CSS (un-display)?

    How to fix this flexbox alignment issue due to unsupported 'flex-grow' in IE10?

    How to make multiple divs always fill out the whole browser size?

    text over horizontal line…How do I make the line gradient?

    How to increase height of footer's div when browser window is resized?

    How to apply CSS generated by colorzilla to the body element [closed]

    How to add style or put a class in a php form_submit button

    How can I replace the text in an

    from a CSS file without using a tag?

    Tricky: In CSS and HTML, how to make a sub DIV go under the container if the container has a z-index of 0?

    How to add my custom css class to a html element