Skip to content

Instantly share code, notes, and snippets.

@ayugioh2003
Last active July 15, 2020 10:42
Show Gist options
  • Save ayugioh2003/e6975e7cc099c94c78ddb8224c1fb776 to your computer and use it in GitHub Desktop.
Save ayugioh2003/e6975e7cc099c94c78ddb8224c1fb776 to your computer and use it in GitHub Desktop.
General sibling combinator test
<span>This is not red.</span>
<label for="">123</label>
<input>
<span>And here is a span span!</span>
<code>Here is some code.</code>
<span>And here is a red span!</span>
<code>More code...</code>
<span>And this is a red span!</span>
<label for="">123</label>
<div class="input-group">
<label for="phone" class="label">PHONE</label>
<input id="phone" type="text" />
</div>
{
"scripts": [],
"styles": []
}
input ~ span,
input ~ label {
color: red;
}
input:focus {
background-color: #666;
}
input:focus ~ span,
input:focus ~ label {
color: blue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment