List different selectors available in CSS and explain in detail
Answer:
Different types of CSS selector are
- Universal Selector
- Element Type Selector
- Class Selector
- 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
Other Question With Answer
Amazing!
ReplyDeleteI like this site very much, Its a really nice situation to read and get info . ny web design firms
ReplyDeleteYour 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
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteChaga 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