What's the difference between pseudo and universal? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What's the difference between pseudo and universal?

10th Jan 2016, 9:27 PM
HECTOR ARTURO AZUZ SANCHEZ
HECTOR ARTURO AZUZ SANCHEZ - avatar
2 Answers
+ 3
pseudo selectors, or pseudo classes, are specific to each state of an element (normal, visited, active, hover), while universal is just their general configuration (same as normal pseudo-state);
4th Mar 2016, 7:34 PM
Alex Lopes
Alex Lopes - avatar
0
A conceptual answer: A pseudo-element refers to things that are part of the document, but you just don't know it yet. For example the first letter. Before you only had text. Now you have a first letter that you can target. It is a new concept, but was always part of the document. This also includes things like ::before; while there isn't actual content there, the concept of something before something else was always there -- now you are specifying it. A pseudo-class is state of something in the DOM. Just like a class is a tag you associate with an element, a pseudo-class is a class that gets associated by the browser or DOM or whatever, usually as a response to a change in state. When a user visits a link -- that link can take on the state of 'visited'. You can imagine the browser applying the class 'visited' to the Anchor element. :visited would then be how you select for that pseudo-class.
23rd Oct 2016, 8:15 PM
Iram