Type Selector,Tag Selector,CSS Pseudo-Classes,CSS Pseudo Elements in CSS
Type Selectors
A type selector is sometimes referred to as a tag name selector or element
selector because it selects an HTML tag/element in your document. Type
selectors are not case-sensitive. In the example below, we have used
the span, em and strong selectors.
CSS Code
Output
Tag Selector
Tag selector is used to redefine existing HTML Tag. Select this option if you
want to change the formatting options for an HTML Tag. In many cases,
redefining existing HTML tags with CSS has Advantages over creating new
Styles.
CSS Code
Output
CSS Pseudo-Classes
A Pseudo class in CSS is used to define the special state of an element. It can
be combined with a CSS selector to add an effect to existing elements based
on their states.
For Example, changing the style of an element when the user hovers over it,
or when a link is visited. All of these can be done using
Pseudo Classes in CSS.
CSS Code
Output
CSS Pseudo
Elements
A CSS pseudo-element is a keyword added to a selector that lets you style a
specific part of the selected elements. For Example, Styling the first letter or
line of an element, and Inserting content before or after the content of an
element. All of these can be done using Pseudo Elements in CSS.
CSS Code
Output
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbMkBXFGhcf2HoUBkvRWqrzl48VqJZ843nbCmJULRPpkinX4Za-ic-dUnG_r-cmRPils232ubqOPu9SV6PJH-qoXiN7YrXI6PglZXGVru2_0LhN8NQmiikNMdFkPpzH_4XSQLX6cFpubjnFbaHAE0uVz2CJ6Pe67XZalDV_eyWwKremrm6Jg_k5w8LgYN2/s72-w566-c-h401/css4.jpg)
No comments: