Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <section id="wrapper">
  
  <header>
    <h1>Scrollbar Fixes </h1>
    <h2>Sort Of...</h2>  
  </header> 
  
 <div id="container">
    <article id="container1"> <!--overflow: hidden-->
    <article id="container2"> <!--overflow: auto-->
       <div class="about">
         <h2>No Scroll Bar</h2>
         <p>Removes ugly scroll bar in Windows, but this means you get no scroll bar.</p>
       </div>
      <h1>No Scroll Bar</h1>
      <img src="http://placehold.it/350x150">     
      <h2>Headline</h2> 
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie neque a nunc malesuada, pretium dictum neque bibendum. Nullam nec aliquet magna. Quisque dictum eros lorem, a efficitur urna dictum eu. Nunc est libero, sollicitudin ac scelerisque vitae, vehicula ac mauris. Aenean tempus ante et enim laoreet, sed pretium ligula maximus. Nunc vestibulum purus vitae ipsum ullamcorper, ut condimentum felis lobortis. Nam tempor ut neque eget auctor. Fusce interdum nibh mi, id ornare tortor euismod non. In interdum fermentum nulla, vitae ultricies dolor ultrices at. Vestibulum ut ex sit amet libero ultrices laoreet. Donec aliquet consectetur urna sed viverra.<p>

     <h2>Headline</h2>
      
     <p>Aenean tristique eget libero sed mollis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris faucibus elit sed nisl vestibulum vulputate. Sed ligula nulla, faucibus ut quam elementum, tempor gravida arcu. Mauris efficitur, purus vitae auctor bibendum, sapien enim commodo massa, non sollicitudin purus elit a purus. Sed vitae dapibus leo. Donec ut tortor a dolor accumsan porta.</p>
      
    <h2>Headline</h2>      

    <p>Integer at vehicula ante, sed lobortis magna. Donec accumsan sit amet nunc non vestibulum. In varius neque at lectus tristique, ac congue eros dapibus. Praesent vulputate risus a molestie aliquet. Duis dignissim, libero sodales commodo elementum, eros elit faucibus massa, vel mattis diam nisl ac erat. Ut sagittis mi justo, eu hendrerit dolor faucibus ut. Aliquam mi ante, fringilla a imperdiet sed, dignissim ut lorem. Aenean malesuada, nibh eu consectetur imperdiet, nisl nisl luctus tortor, vel interdum nunc lorem a justo. Donec sodales eleifend neque a varius. Donec magna sem, condimentum ac convallis nec, dignissim eget nulla. Praesent pharetra et eros vitae placerat. Aenean sodales risus sit amet lacus maximus semper. Nam accumsan ut sem eu consectetur.</p></article></article>
    </div>
  
  <div id="container" class="scrollBoxTwo">
    <div class="about">
      <h2>Custom Scrollbar</h2>
      <p>Only available in webkit browsers. &nbsp : (</p>
    </div>
    <h1>Has Scroll Bar</h1>
    <img src="http://placehold.it/350x150">     
    <h2>Headline</h2> 
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie neque a nunc malesuada, pretium dictum neque bibendum. Nullam nec aliquet magna. Quisque dictum eros lorem, a efficitur urna dictum eu. Nunc est libero, sollicitudin ac scelerisque vitae, vehicula ac mauris. Aenean tempus ante et enim laoreet, sed pretium ligula maximus. Nunc vestibulum purus vitae ipsum ullamcorper, ut condimentum felis lobortis. Nam tempor ut neque eget auctor. Fusce interdum nibh mi, id ornare tortor euismod non. In interdum fermentum nulla, vitae ultricies dolor ultrices at. Vestibulum ut ex sit amet libero ultrices laoreet. Donec aliquet consectetur urna sed viverra.<p>

   <h2>Headline</h2>
      
   <p>Aenean tristique eget libero sed mollis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris faucibus elit sed nisl vestibulum vulputate. Sed ligula nulla, faucibus ut quam elementum, tempor gravida arcu. Mauris efficitur, purus vitae auctor bibendum, sapien enim commodo massa, non sollicitudin purus elit a purus. Sed vitae dapibus leo. Donec ut tortor a dolor accumsan porta.</p>
      
   <h2>Headline</h2>      

   <p>Integer at vehicula ante, sed lobortis magna. Donec accumsan sit amet nunc non vestibulum. In varius neque at lectus tristique, ac congue eros dapibus. Praesent vulputate risus a molestie aliquet. Duis dignissim, libero sodales commodo elementum, eros elit faucibus massa, vel mattis diam nisl ac erat. Ut sagittis mi justo, eu hendrerit dolor faucibus ut. Aliquam mi ante, fringilla a imperdiet sed, dignissim ut lorem. Aenean malesuada, nibh eu consectetur imperdiet, nisl nisl luctus tortor, vel interdum nunc lorem a justo. Donec sodales eleifend neque a varius. Donec magna sem, condimentum ac convallis nec, dignissim eget nulla. Praesent pharetra et eros vitae placerat. Aenean sodales risus sit amet lacus maximus semper. Nam accumsan ut sem eu consectetur.</p>
  </div>
  
  <article id="colophon">
    <p>Came across an issue with the overflow auto scroll bar. It worked fine in most browsers, but on windows it not only looked ugly, but added unwanted space to the div (the container in question had a fixed width). A google search came up with little good alternatives other than the no scroll bar hack above, which can be confusing from a user experience standpoint. The content may be placed in a way though to inply more content further down. Customizing the scrollbar is another option but isn't supported in IE or Firefox.</p>
  </article>
  
</section> 
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
$color-dark: #3f3437;
$smoke: #191919;
$burnt: #462E32;

/*
------------------
styles for box 1
------------------
 The outer container will have overflow hidden.
 The inner container will have overflow auto.
 This requires a height, in this pen it is in the id "container"*/ 

#container1{
    height: 100%;
   /* +3% width extend to end of div*/
    width: 103%; 
    overflow: hidden;
   }

#container2{
    width: 100%;
    height: 100%;
    overflow: auto;
   /*push scroll bar out of div*/
    padding-right: 20px;
}

/*
------------------
styles for box 2
------------------
*/
.scrollBoxTwo{
  height: 100%;
  overflow-y: auto;
}
/*styling for the scrollbar*/
  /*style for the scroll bar area*/
.scrollBoxTwo::-webkit-scrollbar{background-color: $smoke;}
  /*style for the scrolling part of the bar*/
.scrollBoxTwo::-webkit-scrollbar-thumb{
  background-color: rgb(48, 48, 48);
} 


/*
-----------------------------------------
styles for the rest of the page and other stuff I didn't really need to do but I did.
-----------------------------------------
*/

body{background-color: $color-dark; font-family: 'Open Sans'; line-height: 150%;}

#wrapper{width: 100%; max-width: 1150px; margin: 0 auto; padding-top: 5vh;}

header{
  h1{font-size: 2.7em; margin-left: 3.5%;}
  h2{font-size: 1.3em; margin: .4em 0 1em 3.5%;;}
}

.about{
  width: 100%;
  height: auto;
  padding: .5em 0 .5em 0;
  margin-bottom: 1em;
  border-bottom: 4px solid $color-dark;
  p{padding-top: 0;}
}

#container{
  width: 47%;
  height: 400px;
  margin: 1%; 
  display: inline-block;
  vertical-align: top;
  margin-bottom: 2em;
  background-color: $smoke; 
  transition: box-shadow .5s ease;
  &:hover{box-shadow: 3px 3px 5px 6px rgba(0, 0, 0, 0.1);}
    img{
      width: 90%; 
      max-width: 350px; 
      margin: 1em 0 .5em 5%;}
}

 h1{
      color: white; 
      font-weight: 700; 
      margin-left: 5%; 
      font-size: 1.5em;} 
    h2{
      color: white; 
      font-weight: 700; 
      margin-left: 5%;}
    p{
      color: white; 
      font-size: .7em; 
      width: 90%; 
      margin-left: 5%; 
      padding-top: 1em;
      &:last-child{padding-bottom: 1em;}}

#colophon{
  width: 96.5%;
  color: white;
  margin: 1%;
  background-color: $burnt;
  padding-bottom: .5em;
  box-shadow: 3px 3px 5px 6px rgba(0, 0, 0, 0.1);
}

@media screen and(max-width: 875px){
  #container{
    width: 80%;
    margin-left: 10%;
    display: block;
  }
  #colophon{
    width: 80%;
    margin-left: 10%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console