Skip to content

Instantly share code, notes, and snippets.

@steve54b
Created June 4, 2015 20:36
Show Gist options
  • Save steve54b/22f6dca5b28b906b7b52 to your computer and use it in GitHub Desktop.
Save steve54b/22f6dca5b28b906b7b52 to your computer and use it in GitHub Desktop.
1) Pseudo classes are combined with selectors to more specifically target
an element that may otherwise be difficult to distinguish from other
elements of the same type. e.g., if you have
<p>yakety-yak</p>
<p>don't talk back</p>
and you want to target only the "don't talk back", you can select it with:
p:nth-of-type(2)
2) Pseudo-elements are combined with selectors to apply styling to a
specified part of a selected element.
e.g., if you have
<p class="like-fer-shur">huh what?
</p>
and you wnat just the 'h' in 'huh' to be blue, you can select it with:
.like-fer-shur::first-letter {
color:blue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment