Pseudo Classes and CSS Elements – Hi friends, meet us again. how are you today? We hope you are always in good health and condition. In this article, we will discuss something related to programming languages, especially the CSS programming language, namely pseudo classes and css pseudo elements. Later, we will discuss the meaning of the two.
Understanding Pseudo Class
Pseudo Class Selector is a CSS selector that is used to access certain parts of HTML that are not written in HTML or arguably part of HTML that cannot be accessed by other simple selectors. The use of pseudo class selectors is actually designed to access a specific condition in HTML.
The following is an example of writing a pseudo class in CSS:
Some pseudo classes that are often used or commonly used in a web page are:
- Link – the pseudo class in the application of links functions to add style to links that have never been visited and clicked.
- Hover – the application on hover is used to add style to an element when the cursor or mouse is over the element.
- Active – serves to add style to the active or currently active element.
- Visited – has a function to add style to links that have been visited before or clicked.
Understanding Pseudo Elements
Pseudo Element is a selector that has a function to select elements and tags automatically. Writing pseudo elements in CSS1 and CSS 2 is to use a colon (:) which is the same as the pseudo class. However, in the CSS3 version, pseudo elements are written using 2 colons (::). This change is intended to make it easier to distinguish between pseudo elements and pseudo classes
The following is an example of the use of pseudo elements:
So much information that we can convey about pseudo classes and pseudo elements, hopefully the information we provide is useful. Please leave a question in the comments column if it’s still not clear, thank you.