Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • CSS selector?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 247
    Comment on it

    CSS selector is a part of CSS rule set which is actually selects the content of your page which you want to give style.

    There are different kinds of selectors available.

    Universal Selector: Apply CSS on all of the elements

    * {
    
       color: red;
    }
    

    Element Type Selector: Apply CSS on the particular attribute or element.

    ul {
       color: red;
    }
    

    ID Selector: Apply css Corresponding to same ID

    #attributeId {
       color: red;
    }
    

    Class Selector: Apply CSS to those which have same Class

    .box {   
       color: red;
    }
    

    Descendant Combinator: Apply Css on those for which we have Combine two or more selectors so that we can be more specific in our selection method.

    #container .box {   
        color: red;
    }
    

    Child Combinator: Apply CSS to the child elements

    #container > .box {
       color: red;
    }
    

    General Sibling Combinator: Apply CSS based on Sibling elements

    h2 ~ p {
       color: red;
    }
    

    Adjacent Sibling Combinator: Apply CSS based on adjacent sibling elements

    p + p {
         color: red;
    }
    

    Attribute Selector: Apply CSS on those particular tag which have same attribute.

    input[type="text"] {
          color: red; 
    }
    

    Pseudo-class: Apply CSS on the class which does exist in the js events.

    a:hover {
       color: red;
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: