<h1>Heading 1</h1>
<p>See <a href="https://alistapart.com/article/axiomatic-css-and-lobotomized-owls" target="_blank">Lobotomized Owl</a> for the general idea of applying margin to the top of elements. The <strong>carefully lobotomized owl</strong> does not use <code>* + *</code>, but some more restrictive selectors like <code>* + p</code>.</p>
<p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<div class="box">
  <h2>Heading 2</h2>
  <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
  <p>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</div>
<div class="box">
  <h2>Heading 2</h2>
  <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
<div class="box">
  <h2>Heading 2</h2>
  <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
  <p>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
  <h3>Heading 3</h3>
  <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
  <h4>Heading 4</h4>
  <p>At vero eos et accusam et justo duo dolores et ea rebum.</p>
  <h3>Heading 3</h3>
  <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
</div>
* { margin: 0; padding: 0; }
* + h1, * + h2, * + h3 { margin-top: 1.5em; }
* + h4, * + p, * + ul, * + ol, * + table { margin-top: 0.5em; }

// No magig below this line
body { padding: 1em 20%; font-family: Tahoma, Arial, sans-serif; line-height: 1.5; }
div { padding: 10px; background-color: rgba(0,255,0,0.3); }
h1, h2, h3 { background-color: rgba(255,255,255,0.5); }
a { color: navy; font-weight: bold; }
code { display:inline-block; background: rgba(0,0,0,0.1); padding: 0 0.2em;}
.box { margin: 30px 0; }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.