CSS Pseudo classes
September 28, 2005 – 8:59 pmThe joys of CSS. Sarah had asked me what a Pseudo class was in css and I did not know. I just now had the opportunity to look it up and realize I have been using it all along.
Any who has writting a:hover has used a pseudo class. The class is simply used to select a subset of a specific class. In the example of the link, it sets the specific hover information. This is easily the most commonly used class.
This little gem can be used for far more than highlighting links however, there are other builtin pseudo classes for HTML elements. To indent the start of every paragraph one could simply say:
p:first-child { text-indent:25px }
You can extend this idea to making all of the first letters of the paragraph larger than life (like a storybook) among many other things. This site has some other Pseudo-Class nodes that are available and descriptions of their application.
Additional Helpful Links:
You must be logged in to post a comment.