Sobre pseudo-clases y pseudo-elementos

2/Jul/2015 236

Las pseudo-clases y los pseudo-elementos son tipos de selectores CSS que permiten alcanzar estados y elementos que no están en el DOM original. La lista de pseudo-clases es amplia, la de pseudo-elementos no ha crecido hasta la actual versión de CSS3 (aunque en CSS4 se vienen varios más):

Pseudo-clases:

  • :link
  • :visited
  • :active
  • :hover
  • :focus
  • :target
  • :empty
  • :enabled
  • :disabled
  • :checked
  • :nth-child(n)
  • :nth-last-child(n)
  • :nth-of-type(n)
  • :nth-last-of-type(n)
  • :first-child
  • :first-of-type
  • :last-of-type
  • :only-child
  • :only-of-type
  • :root
  • :lang(x)
  • :not(s)

Pseudo-elementos:

  • ::before
  • ::after
  • ::first-line
  • ::first-letter

Mientras las pseudo-clases se encargan de entregar una manera de seleccionar elementos HTML basados en la información que no es accesible en el DOM (por ejemplo, el estado :active ó su posición basado en los elementos hermanos como :nth-of-type()), los pseudo-elementos crean una abstracción en el DOM creando un nuevo elemento virtual el que puede ser manipulado en su contenido y forma (por ejemplo ::before).

Nomenclatura:

El estándar CSS2.1 define a ambos con doble-punto (:) pero en CSS3 las pseudo-clases se prefijan con doble-punto (:) y los pseudo-elementos con doble-doble-punto (::). Lamentablemente nos queda IE8 en el regazo, soportando estas útiles e importantes pseudo-propiedades sólo con doble-punto (:); como consecuencia todos los browsers siguen soportando ambas nomenclaturas. Si sigues soportando IE8, debes usar doble-punto (:); caso contrario puedes utilizar doble-doble-punto (::) para pseudo-elementos si quieres obedecer las reglas CSS3 de W3C.

Links:

Comentarios

  1. kyrie 6 shoes [#]

    I needed to post you this tiny remark to finally give many thanks over again over the precious pointers you have shown on this site. This is extremely open-handed with people like you to deliver openly just what a few individuals could possibly have supplied as an e-book in order to make some money on their own, notably now that you could have tried it in the event you considered necessary. Those ideas likewise acted to become great way to comprehend some people have similar interest the same as my own to know the truth more with respect to this matter. Certainly there are several more fun instances up front for many who see your site.

  2. giannis shoes [#]

    I definitely wanted to construct a brief word to be able to appreciate you for those superb steps you are showing on this site. My time intensive internet investigation has at the end been compensated with wonderful content to share with my company. I ‘d admit that many of us site visitors are undoubtedly blessed to exist in a fantastic website with very many special people with beneficial points. I feel quite grateful to have used the site and look forward to so many more amazing moments reading here. Thanks a lot again for all the details.

  3. golden goose sneakers [#]

    I actually wanted to make a comment to be able to say thanks to you for some of the wonderful techniques you are writing at this website. My time consuming internet investigation has now been rewarded with excellent details to exchange with my good friends. I ‘d assert that we site visitors are really endowed to exist in a fantastic site with very many outstanding professionals with very beneficial suggestions. I feel somewhat blessed to have used your entire webpages and look forward to tons of more brilliant times reading here. Thanks once again for a lot of things.

  4. kyrie 7 shoes [#]

    I as well as my friends came reviewing the good items found on your web blog then quickly I got an awful suspicion I had not thanked the site owner for those strategies. These young boys are actually certainly excited to learn all of them and have in effect seriously been using them. Many thanks for turning out to be really helpful and for choosing such important useful guides most people are really eager to understand about. My personal honest regret for not expressing appreciation to earlier.

  5. birkin bag [#]

    Thank you a lot for providing individuals with an extremely marvellous possiblity to read articles and blog posts from this site. It can be so brilliant plus jam-packed with amusement for me and my office co-workers to search your website at least three times a week to study the newest items you will have. And indeed, I am also usually satisfied for the special strategies you give. Some 3 facts in this post are definitely the most suitable I’ve had.

  6. Alanblabs [#]

    metformin hydrochloride 500 mg

  7. zithromaxeska [#]

    zithromax 250 azithromycin for staph skin infection is zithromax a strong antibiotic

  8. zithromaxeska [#]

    zpack and uti citromax zithromax-azithromycin

  9. zyrtec d otc [#]

    periactin – https://allergyd.com

  10. cap stromectol 12mg [#]

    buying stromectol

    lawsuit osseointegration nature

  11. pharmacepticacom [#]

    hcq medical abbreviation https://pharmaceptica.com/

  12. ivermectina [#]

    General Information Here this by-product
    https://ivermectstromect.com can you buy ivermectin over the counter
    https://ivermectstromect.com ivermectin for humans where to buy locally near me
    https://stromectolivermect.com stromectol
    https://ivermectinstrom.com ivermectin for humans over the counter in mexico
    https://ivermectinst.com stromectol manufacturer

  13. isotretinoine [#]

    accutane for acne isotretinoina

  14. yeezy supply [#]

    I want to express my appreciation to the writer just for rescuing me from this type of crisis. Because of looking throughout the world-wide-web and meeting strategies which were not powerful, I was thinking my life was gone. Being alive minus the solutions to the problems you’ve solved as a result of the website is a crucial case, and ones that might have in a negative way affected my entire career if I had not noticed the blog. The ability and kindness in maneuvering all things was crucial. I don’t know what I would have done if I hadn’t come across such a step like this. I can at this time look forward to my future. Thanks a lot so much for your professional and sensible help. I will not think twice to suggest your web site to any person who ought to have counselling about this subject.

  15. bape [#]

    I simply wanted to thank you very much yet again. I do not know the things that I would’ve undertaken in the absence of these tips contributed by you regarding this problem. It has been a hard case in my circumstances, nevertheless coming across a new specialised avenue you processed that took me to weep over fulfillment. I’m thankful for your advice and even pray you really know what a powerful job you are always getting into teaching people today through the use of a blog. I’m certain you’ve never come across all of us.

  16. bape [#]

    My husband and i were so ecstatic that Peter managed to deal with his research using the precious recommendations he obtained when using the weblog. It’s not at all simplistic just to happen to be giving away guidance which usually the rest may have been trying to sell. And now we already know we’ve got the blog owner to give thanks to for this. The explanations you have made, the easy website menu, the friendships your site aid to promote – it’s got all sensational, and it’s really facilitating our son in addition to the family do think the subject matter is awesome, which is certainly very pressing. Thanks for the whole lot!

  17. kobe basketball shoes [#]

    I want to show some thanks to the writer for rescuing me from this particular matter. After looking throughout the online world and seeing proposals which were not powerful, I thought my entire life was over. Living without the presence of approaches to the difficulties you have solved as a result of your good posting is a crucial case, and the ones that would have adversely affected my career if I hadn’t discovered your blog post. Your primary mastery and kindness in handling all areas was important. I’m not sure what I would’ve done if I hadn’t come across such a point like this. I can at this time look forward to my future. Thank you so much for your specialized and result oriented help. I won’t be reluctant to recommend your blog post to anyone who needs recommendations on this area.

  18. hermes online [#]

    I wish to show my love for your generosity supporting men and women that must have help with the theme. Your special commitment to getting the solution all-around has been remarkably beneficial and have really made girls much like me to get to their aims. This warm and friendly guidelines means a lot a person like me and much more to my fellow workers. Thanks a ton; from everyone of us.

  19. provigilpill [#]

    modafinil vs adderall modalert 100 price india

  20. bactrim dosing [#]

    trimethoprim sulfamethoxazole 800 mg trimethoprim

  21. stromectol over the counter walgreens [#]

    stromectol http://stromectolforte.com/# ivermectin for humans can you buy stromectol over the counter

  22. canine ivermectin for sale [#]

    generic ivermectin http://stromectolforte.com/ ivermectin clinical trials ivermectin tablets

  23. pharmaceptica.com [#]

    erectile problems https://www.pharmaceptica.com/

  24. prednisoneonline [#]

    what is prednisolone prednisone no rx

  25. pendik evden eve nakliyat [#]

    pendik evden eve nakliyatt

    Εvden eve nakliyat Pendik Ьölgеsinde bulunan en kökⅼü ve kaⅼiteli
    nakliyat şirketlerі. Kuşaklardan beri eşya taşıma işlemlerinde size desteҝ sağlıyoruz.
    Sizdе kaliteli bir taşıma istiyorsunuz hemen bize yazabilirsiniz.

    pendik evden eve nakliyat

  26. ordermodafinil [#]

    modafinil 100mg modafinil pill

  27. bactrim side effects [#]

    sulfamethoxazole side effects bactrim for uti

  28. off white [#]

    I and my pals were found to be going through the good helpful hints found on your web blog and before long developed a terrible feeling I had not thanked the web site owner for those secrets. All of the women happened to be consequently passionate to study all of them and have now simply been using those things. Many thanks for actually being really accommodating and for making a choice on this sort of brilliant guides most people are really desirous to learn about. Our own sincere apologies for not expressing appreciation to earlier.

  29. hermes birkin [#]

    I happen to be writing to let you know what a incredible encounter my wife’s daughter undergone visiting yuor web blog. She realized some pieces, not to mention what it is like to possess a very effective teaching nature to get folks completely comprehend several multifaceted subject areas. You truly surpassed our own desires. Thank you for churning out such practical, dependable, informative not to mention fun tips on the topic to Gloria.

  30. yeezys [#]

    My spouse and i felt absolutely lucky when Raymond managed to round up his investigation out of the precious recommendations he discovered out of your blog. It’s not at all simplistic to simply always be giving for free steps which usually some other people may have been selling. We really already know we’ve got the website owner to give thanks to because of that. The illustrations you’ve made, the simple site navigation, the relationships you can give support to instill – it’s everything impressive, and it’s assisting our son in addition to the family believe that that subject matter is excellent, and that is wonderfully mandatory. Many thanks for everything!

  31. stone island t shirt [#]

    I am glad for commenting to make you be aware of what a nice encounter my cousin’s princess obtained browsing your web site. She even learned too many details, which included what it is like to have an awesome helping character to make a number of people easily grasp some tricky subject areas. You actually did more than my desires. Thank you for distributing these warm and helpful, dependable, informative and in addition unique guidance on your topic to Lizeth.

  32. modafinilandalcohol [#]

    provigil cost https://modafinilprovigilok.com/

  33. bactrim for uti [#]

    https://bactrimtrimoxazole.com/ trimethoprim side effects

  34. stromectol ivermectin [#]

    Global Message About this offshoot
    https://ivermectinst.com stromectol
    https://ivermectinst.com ivermectin for humans
    https://ivermectinstrom.com ivermectin 12 mg
    https://ivermectinstrom.com ivermectin for sale
    https://ivermectstromect.com stromectol

  35. hermes belt [#]

    I needed to post you that little note so as to give many thanks again on your splendid opinions you’ve documented here. This has been unbelievably generous of you to allow unreservedly what a lot of people could have marketed for an e book to help make some bucks for themselves, primarily since you could have done it in the event you desired. Those good tips also acted like the good way to recognize that some people have the same dreams really like my personal own to find out a great deal more when it comes to this condition. I am certain there are many more pleasurable periods in the future for individuals that scan through your blog post.

CSSLab