Skip to content

Instantly share code, notes, and snippets.

@sergx
Created May 10, 2014 09:29
Show Gist options
  • Save sergx/9e8f26d55ee6695ffee3 to your computer and use it in GitHub Desktop.
Save sergx/9e8f26d55ee6695ffee3 to your computer and use it in GitHub Desktop.
div div {
border:1px solid #ccc;
float: left;
margin:15px;
}
p {border:1px solid; margin:50px; width:25px;height:25px; font-size:20px; line-height:25px; text-align:center;}
div div:nth-last-child(3):nth-child(1) p, div div:nth-last-child(3):nth-child(1) ~ div p{
border:2px solid red;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<div><p></p></div>
<div><p></p></div>
<div><p></p></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment