CSS selector
CSS selector: There are five types of selectors used in the CSS language. Simple selectors Combinator selectors Pseudo-class selectors Pseudo-element selectors Attribute selectors Here, we will discuss the simple selectors of the CSS language. The CSS element selector: By name, this selector is select direct the elements of HTML Example: h1{ Color: red; Background-color:white; text-align:center; } The CSS id selector The id attribute is used in the HTML page for selecting the unique element. These id attributes are also used for styling in the CSS. How to style the id in CSS? For the select elements with a unique id use hashtag(#) followed by the name of the id. Example: #header{ Color: red; Background-color:white; text-align:center; } How to style class in id? The CSS class selector: The class selector selects the element of HTML which uses the class attribute. The dot(.) followed by the class name used for styling the class attribute. Following is an example of the class selector.