1.

CSS Selectors

Answer»
COMMANDDESCRIPTIONSYNTAX
UNIVERSAL SELECTORThe CSS universal selector (*) matches elements of any type. When utilising @namespace, universal selectors can be namespaced. {}
ID SELECTORThe CSS ID selector matches an element based on the value of the element’s id attribute. This is what you'd use to refer to that one-of-a-kind element with an id. id {}
CLASS SELECTORThe CSS class selector matches elements based on the contents of their class.  .class {}
TYPE SELECTORIt selects all elements of the given type within a document. In other words, the type selector in CSS matches components based on their node names. h1, h2 ,h3 {}
ADJACENT SIBLING SELECTORThe adjacent sibling combinator (+) separates two selectors. It comes right after the first element, and they're both children of the same parent. h1 + p {}
CHILD SELECTORThe child combinator (>) is placed between two CSS selectors. ul > li {}
GENERAL SIBLING SELECTORSelect all elements that follow the first element such that both are children of the same parent. h1 ~ p {}
DESCENDANT SELECTORAny selector with white space between two selectors without a combinator. p a {}



Discussion

No Comment Found