Skip to content

Instantly share code, notes, and snippets.

@rubys
Created August 22, 2018 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubys/a98cf90cd7e324b61bd8772d9dcaa6e1 to your computer and use it in GitHub Desktop.
Save rubys/a98cf90cd7e324b61bd8772d9dcaa6e1 to your computer and use it in GitHub Desktop.
if the first item in a div is an h3, don't put a border on it
<!DOCTYPE html>
<style>
h3 {border: 1px solid black}
div>h3:first-child {border: none}
</style>
<div>
<h3>..</h3> <!-- no border on h3 -->
<p>....</p>
</div>
BUT
<div>
<p>....</p>
<h3>...</h3> <!-- would have a border on h3 -->
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment