CodePen

HTML

            
              <div class="module">
  Raw content
</div>

<div class="module">
  <h3>Module</h3>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</div>

<div class="module">
  <h3>Module</h3>
  <ul>
    <li>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores impedit.</p>
    </li>
    <li>
      <p>Dolor possimus perspiciatis laboriosam sapiente labore inventore enim cumque quasi.</p>
    </li>
    <li>
      <p>Neque autem ad saepe nam dignissimos fugit soluta quidem ducimus?</p>
    </li>
  </ul>
</div>

<div class="module">
  <h3>Module</h3>
  <ol>
    <li>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores impedit.</p>
    </li>
    <li>
      <p>Dolor possimus perspiciatis laboriosam sapiente labore inventore enim cumque quasi.</p>
    </li>
    <li>
      <p>Neque autem ad saepe nam dignissimos fugit soluta quidem ducimus?</p>
    </li>
  </ol>
</div>

<div class="module">
  <h3>Module</h3>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam.</p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam.</p>
</div>


<button id="padding">Toggle Visual Padding</button>
            
          
!

CSS

            
              /* Possible Fix */
.module > :last-child,
.module > :last-child > :last-child,
.module > :last-child > :last-child > :last-child{
  margin: 0;
}


html {
  background: #333;
}
.module {
  width: 20rem;
  padding: 1.5rem;
  margin: 1.5rem auto;
  background: white;
}
.module.see-the-padding {
  background: lightyellow;
  background-clip: content-box;
  position: relative;
}
.module.see-the-padding::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
}
.module.see-the-padding > * {
  background: rgba(0, 0, 0, 0.2);
  background-clip: content-box;
}


h3 {
  margin: 0 0 0.75rem 0;
  border-bottom: 1px solid #ccc;
  padding: 0 0 0.25rem 0;
}
p {
  margin: 0 0 1rem 0;
}

#padding {
  position: fixed;
  top: 20px;
  right: 20px;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              $("#padding").on("click", function() {
  $(".module").toggleClass("see-the-padding");
});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................