How to give a css code for combined classes in HTML [duplicate]


Tags: css,html5

Problem :

This question already has an answer here:

I have got two classes coming under list "active" and "main-tab-list like and want to give a css for this combined classes.



Solution :

Just cascade them

 .main-tab-list.active{color:red;}

This ensures that only .main-tab-list which are active will be selected. Other classes who also have .active class on it won't be affected. It simply says, apply this rule to all .main-tab-list classes which at the same time have .active class


    CSS Howto..

    How to draw a Normal Distribution Curve (Bell curve) using CSS and JavaScript?

    How can I use css files in django?

    How to use a variable for a path with Stylus?

    How to expand sidebars sub-menu to the correct size?

    How to make these jquery pop ups fall back to css when javascript disabled

    How to create custom border style in JavaFX CSS?

    How to zoom into a specific location of an image using CSS

    How do I display an empty div tag with CSS?

    How do I keep my background image at the bottom of the page?

    How to centralise a button div

    How to create a vertical linear gradient for a GTK separator

    How to define absolute positioned element's anchor point?

    HTML/CSS/jQuery: How to set an “absolute text bottom” so that further text expands upwards?

    HTML/CSS/JAVASCRIPT : How to move an element and not show scrollbars

    How can I put styleName (css) on ui.xml to HTML5 input element (range)

    How to get rid of scrollbars around iframe

    How to center this grid layout with css? [closed]

    How to align text next to an icon with CSS?

    How to make outer div inherit height of inner, non-floated divs?

    Can somebody explain how I should use @font-face for my site?

    How to position a div that already has a float?

    How the browser identifies the CSS framework? [closed]

    How can I vertically align a font-awesome input checkbox with its label?

    IE11 dosen't show CSS-Content properly

    How to create fixed sidebar with Skeleton CSS?

    How to unbind() a hover/ mouseover event?

    How to position children with respect to parent in CSS?

    Can't figure out how to make a box with multiple images with CSS/HTML

    How to Set the Left and Top CSS Positioning of a DIV Element Dynamically Using JavaScript

    While scrolling, The current div goes up, and another div under it (under the first div background) shows