List different selectors available in CSS and explain in detail

List different selectors available in CSS and explain in detail


Answer:


Different types of CSS selector are

  1. Universal Selector
  2. Element Type Selector
  3. Class Selector
  4. Id Selector

Universal Selector

It selects all the elements in the Html file.

Example
*{
color:red;
font-size:20px;
}

Element Type selector

It will select respective element like img,a,ul,li,th etc

Example
ul{
color:red;
}
p{
font-size:20px;
}

Id Selector

It will select based on id.we have to add #(hash) at the beginning of id to use id selector.

Example

#id1{
color:green;
}
#abc{
color:red;
}

Class Selector

It will Select Based on class.we have to add . (dot) at the beginning of class to use a class selector.

Example
.class1{
color:blue;
}
.xyz{
color:red;
}

Other Question With Answer


















7 comments:

  1. Replies
    1. Great Article IoT Projects for Students

      Deep Learning Projects for Final Year

      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. I like this site very much, Its a really nice situation to read and get info . ny web design firms

    ReplyDelete
  3. Your home is valueble for me. Thanks!? This web page is really a walk-via for all of the information you needed about this and didn know who to ask. Glimpse right here, and you l definitely uncover it. web design agency new york

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I discovered your blog site internet site on the internet and appearance some of your early posts. Continue to keep in the great operate. I just now additional increase your Rss to my MSN News Reader. Seeking toward reading far more from you finding out at a later date!… best branding agencies san francisco

    ReplyDelete
  6. Chaga mushroom coffee been recently brought to plenty of everything about simply because of the Ukrainian article author Alexandr Solzhenitsyn by it’s new ‘Cancer Ward’ in which traditional qualities is generally cured of a tumors on the help consume. Siberian Chaga ux agency san francisco

    ReplyDelete

For Query and doubts!

Powered by Blogger.