<div class="fixed">fixed</div>
<div class="content">
  <h3>fixed</h3>
<p>
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  Just like absolutely positioned elements,     the element is removed from the flow of the   document.They behave in almost the same       way, only that fixed positioned elements     are always relative to the document, not     any particular parent, and are unaffected     by scrolling.
  
</p>
</div>
.fixed{
  background: #2c3e50;
  color: #bdc3c7;
  padding: 15px;
  width: 100%;
  position: fixed;
}
.content{
  background:#95a5a6;
  color:#ecf0f1;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.