Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement :nth-child, :nth-last-child, :nth-of-type, :nth-last-of-typ…
…e, :first-of-type, :last-of-type and :only-of-type Selectors Level 3 pseudo-classes
- Loading branch information
1 parent
238741f
commit 991d4d8
Showing
17 changed files
with
1,207 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>:first-of-type test</title> | ||
<style type="text/css"> | ||
/* should not match according to Selectors 3 because html has no parent element */ | ||
html:first-of-type { background: red; } | ||
|
||
div > p, | ||
div > div, | ||
div > address { | ||
float: left; | ||
width: 20px; | ||
height: 20px; | ||
margin: 0px; | ||
margin-right: 10px; | ||
padding: 0px; | ||
} | ||
div > p { | ||
background: white; | ||
} | ||
div > div, | ||
div > address { | ||
background: black; | ||
} | ||
body > div { clear: both; margin-bottom: 10px; } | ||
|
||
#d1 > .ok { background: red; } | ||
#d1 > *:first-of-type { background: green } | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="d1"> | ||
<p class="ok"> </p> | ||
<div class="ok"> </div> | ||
<div> </div> | ||
<p> </p> | ||
<address class="ok"> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
<address> </address> | ||
<address> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>:first-of-type test</title> | ||
<style type="text/css"> | ||
div > p, | ||
div > div, | ||
div > address { | ||
float: left; | ||
width: 20px; | ||
height: 20px; | ||
margin: 0px; | ||
margin-right: 10px; | ||
padding: 0px; | ||
} | ||
div > p { | ||
background: white; | ||
} | ||
div > div, | ||
div > address { | ||
background: black; | ||
} | ||
body > div { clear: both; margin-bottom: 10px; } | ||
|
||
#d1 > .ok { background: green; } | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="d1"> | ||
<p class="ok"> </p> | ||
<div class="ok"> </div> | ||
<div> </div> | ||
<p> </p> | ||
<address class="ok"> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
<address> </address> | ||
<address> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>:last-of-type test</title> | ||
<style type="text/css"> | ||
/* should not match according to Selectors 3 because html has no parent element */ | ||
html:last-of-type { background: red; } | ||
|
||
div > p, | ||
div > div, | ||
div > address { | ||
float: left; | ||
width: 20px; | ||
height: 20px; | ||
margin: 0px; | ||
margin-right: 10px; | ||
padding: 0px; | ||
} | ||
div > p { | ||
background: white; | ||
} | ||
div > div, | ||
div > address { | ||
background: black; | ||
} | ||
body > div { clear: both; margin-bottom: 10px; } | ||
|
||
#d1 > .ok { background: red; } | ||
#d1 > *:last-of-type { background: green } | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="d1"> | ||
<p> </p> | ||
<div> </div> | ||
<div> </div> | ||
<p> </p> | ||
<address> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
<address> </address> | ||
<address class="ok"> </address> | ||
<p> </p> | ||
<div class="ok"> </div> | ||
<p> </p> | ||
<p class="ok"> </p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>:last-of-type test</title> | ||
<style type="text/css"> | ||
div > p, | ||
div > div, | ||
div > address { | ||
float: left; | ||
width: 20px; | ||
height: 20px; | ||
margin: 0px; | ||
margin-right: 10px; | ||
padding: 0px; | ||
} | ||
div > p { | ||
background: white; | ||
} | ||
div > div, | ||
div > address { | ||
background: black; | ||
} | ||
body > div { clear: both; margin-bottom: 10px; } | ||
|
||
#d1 > .ok { background: green; } | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="d1"> | ||
<p> </p> | ||
<div> </div> | ||
<div> </div> | ||
<p> </p> | ||
<address> </address> | ||
<p> </p> | ||
<div> </div> | ||
<p> </p> | ||
<p> </p> | ||
<address> </address> | ||
<address class="ok"> </address> | ||
<p> </p> | ||
<div class="ok"> </div> | ||
<p> </p> | ||
<p class="ok"> </p> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.