编写跨浏览器兼容的 CSS 代码的金科玉律

css3选择器

marz posted @ Aug 11, 2010 01:00:24 AM in css , 1669 readers
Pattern Meaning Described in section First defined in CSS level
* any element Universal selector 2
E an element of type E Type selector 1
E[foo] an E element with a "foo" attribute Attribute selectors 2
E[foo="bar"] an E element whose "foo" attribute value is exactly equal to "bar" Attribute selectors 2
E[foo~="bar"] an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar" Attribute selectors 2
E[foo^="bar"] an E element whose "foo" attribute value begins exactly with the string "bar" Attribute selectors 3
E[foo$="bar"] an E element whose "foo" attribute value ends exactly with the string "bar" Attribute selectors 3
E[foo*="bar"] an E element whose "foo" attribute value contains the substring "bar" Attribute selectors 3
E[foo|="en"] an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en" Attribute selectors 2
E:root an E element, root of the document Structural pseudo-classes 3
E:nth-child(n) an E element, the n-th child of its parent Structural pseudo-classes 3
E:nth-last-child(n) an E element, the n-th child of its parent, counting from the last one Structural pseudo-classes 3
E:nth-of-type(n) an E element, the n-th sibling of its type Structural pseudo-classes 3
E:nth-last-of-type(n) an E element, the n-th sibling of its type, counting from the last one Structural pseudo-classes 3
E:first-child an E element, first child of its parent Structural pseudo-classes 2
E:last-child an E element, last child of its parent Structural pseudo-classes 3
E:first-of-type an E element, first sibling of its type Structural pseudo-classes 3
E:last-of-type an E element, last sibling of its type Structural pseudo-classes 3
E:only-child an E element, only child of its parent Structural pseudo-classes 3
E:only-of-type an E element, only sibling of its type Structural pseudo-classes 3
E:empty an E element that has no children (including text nodes) Structural pseudo-classes 3
E:link
E:visited
an E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited) The link pseudo-classes 1
E:active
E:hover
E:focus
an E element during certain user actions The user action pseudo-classes 1 and 2
E:target an E element being the target of the referring URI The target pseudo-class 3
E:lang(fr) an element of type E in language "fr" (the document language specifies how language is determined) The :lang() pseudo-class 2
E:enabled
E:disabled
a user interface element E which is enabled or disabled The UI element states pseudo-classes 3
E:checked a user interface element E which is checked (for instance a radio-button or checkbox) The UI element states pseudo-classes 3
E::first-line the first formatted line of an E element The ::first-line pseudo-element 1
E::first-letter the first formatted letter of an E element The ::first-letter pseudo-element 1
E::before generated content before an E element The ::before pseudo-element 2
E::after generated content after an E element The ::after pseudo-element 2
E.warning an E element whose class is "warning" (the document language specifies how class is determined). Class selectors 1
E#myid an E element with ID equal to "myid". ID selectors 1
E:not(s) an E element that does not match simple selector s Negation pseudo-class 3
E F an F element descendant of an E element Descendant combinator 1
E > F an F element child of an E element Child combinator 2
E + F an F element immediately preceded by an E element Adjacent sibling combinator 2
E ~ F an F element preceded by an E element General sibling combinator 3

The meaning of each selector is derived from the table above by prepending "matches" to the contents of each cell in the "Meaning" column.

ref:www.w3.org/TR/css3-selectors/

  • No match
  • No match
Ten said:
Jul 02, 2021 07:10:09 PM

I'm a CS student. I must say that css3 selector is very useful for students like me. Commercial Loans It is full of informative content and a good reference for me to learn. Each one is listed very thoroughly and along with the example.

Taylor said:
Jul 15, 2021 01:56:55 AM

The call functions are shared here as a table to make it easier to understand the purpose of each function. It's a great idea and it helped me a lot to figure out the program easier.  useful link Hope to see more examples shared here.

 

zaiya said:
Sep 21, 2021 12:17:13 PM

Good to know about this CSS call functions. cheap real diamond rings It is well organized so that it was very easy for me to look and learn these ones. Thank you so much for helping me like this one.

meidir said:
Dec 06, 2022 03:46:22 AM

Spot on with this write-up, I truly assume this website wants rather more consideration. in all probability be again to learn way more, thanks for that info. 메이저사이트

 

==================

 

Saw a tweet on Twitter about wholesale bulk t-shirts, and it lead me here. 二手Macbook

meidir said:
Dec 26, 2022 10:30:55 PM

Effect hustings comestible pills phentermine online which can effectively build up weight reducing, actual is capital to glom for pills that have already the ingredients designed to exalt your bodys metabolism, or power for the body to flame useless fats. محامي قضايا عمالية جدة

 

==============

 

oh well, eddie murphy is one of the best comedians that i have seen, his jokes are topnotch and super the best” محامي في الرياض

 

==============

 

I countenance, I individual not been on this webpage in a overnight time? withal it was added pleasance to see It is much an must theme and ignored by so numerous, flat professionals. I convey you to provide making grouping more knowing of realistic issueExcellent matter as characteristic. محامي تجاري بالرياض

 

==============

 

I don’t unremarkably comment but I gotta say thank you for the post on this special one . محامي جنائي الرياض

 

==============

 

Acquiring some separation lawyers permits a portion of the pressure to make sure you settle down in a breakup. محامي استشارات مجانية جدة

meidir said:
Jan 11, 2023 05:40:16 PM

Great post! I?m just starting out in community management/marketing media and trying to learn how to do it well – resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case 카지노사이트

meidir said:
Feb 09, 2023 09:13:51 PM

Merely wanna input that you have a very decent site, I like the style and design it really stands out. Software Contract Lawyer

 

 

===========================

 

 

When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the identical comment. Is there any way you’ll be able to take away me from that service? Thanks! Software Contract Attorney

meidir said:
Feb 18, 2023 11:18:22 PM

Can I simply say what a reduction to seek out somebody who actually knows what theyre talking about on the internet. You definitely know tips on how to convey an issue to mild and make it important. More people have to learn this and perceive this side of the story. I cant imagine youre no more standard since you definitely have the gift. 슈어맨

meidir said:
Apr 22, 2023 03:37:51 AM

Hello! I simply would wish to give a huge thumbs up to the wonderful info you’ve got here for this post. I will be returning to your website to get more detailed soon. it support Singapore

meidir said:
Jun 30, 2023 01:11:44 AM

Spot i’ll carry on with this write-up, I really believe this amazing site needs a great deal more consideration. I’ll more likely once again to learn to read much more, many thanks for that info. printer repairs

meidir said:
Oct 13, 2023 02:17:59 PM

You are so cool man, the post on your blogs are super great.:~.~~ weight

meidir said:
Jan 21, 2024 05:53:39 AM

I simply found your web site some days ago and i are reading through it frequently. you have got a wide range of helpful data on the site and that i conjointly really like the particular type of the site at constant time. carry on the nice work! AI Agents for Task Management


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter