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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 309
    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

    1. * {
    2.  
    3. color: red;
    4. }

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

    1. ul {
    2. color: red;
    3. }

    ID Selector: Apply css Corresponding to same ID

    1. #attributeId {
    2. color: red;
    3. }

    Class Selector: Apply CSS to those which have same Class

    1. .box {
    2. color: red;
    3. }

    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.

    1. #container .box {
    2. color: red;
    3. }

    Child Combinator: Apply CSS to the child elements

    1. #container > .box {
    2. color: red;
    3. }

    General Sibling Combinator: Apply CSS based on Sibling elements

    1. h2 ~ p {
    2. color: red;
    3. }

    Adjacent Sibling Combinator: Apply CSS based on adjacent sibling elements

    1. p + p {
    2. color: red;
    3. }

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

    1. input[type="text"] {
    2. color: red;
    3. }

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

    1. a:hover {
    2. color: red;
    3. }

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: