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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="main">
  <div class="box-wrapper">
    <h2>overflow: auto;</h2>
    <div id="auto" class="box"></div>
  </div>
  <div class="box-wrapper">
   <h2>overflow: scroll;</h2>
   <div id="scroll" class="box"></div>
  </div>
  <div class="box-wrapper">
    <h2>overflow: hidden;</h2>
    <div id="hidden" class="box"></div>
  </div>
   <div class="box-wrapper">
    <h2>overflow: visible;</h2>
    <div id="visible" class="box"></div>
  </div>
</div>
              
            
!

CSS

              
                * {
 font-family: 'Noto Sans KR', sans-serif;
 box-sizing: border-box;
 line-height: 1.7em;
 color: #333;
 background-color: khaki;
}

#main {
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 min-width: 300px;
}

.box-wrapper {
 margin: 20px;
}

.box {
 width: 300px;
 height: 300px;
 padding: 15px;
 background-color: lightgray;
}

#auto {
 overflow: auto;
}

#scroll {
 overflow: scroll;
}

#hidden {
 overflow: hidden;
}

#visible {
 overflow: visible;
}

::-webkit-scrollbar {
    -webkit-appearance: none;
}

::-webkit-scrollbar:vertical {
    width: 12px;
}

::-webkit-scrollbar:horizontal {
    height: 12px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .4);
    border-radius: 10px;
    border: 2px solid #ffffff;
}

::-webkit-scrollbar-track {
    background-color: #ffffff;
}
              
            
!

JS

              
                const text = `overflow CSS 속성은 그것의 블록 레벨 컨테이너(block-level container)보다 내용(content)이 너무 클 때(즉, 내용을 감싸고 있는 영역보다 커졌을 때), 내용을 잘라낼 지, 스크롤 바를 보여줄 지, 혹은 범위를 넘어가게 보여줄 지를 기술합니다. visible(기본값)이 아닌 다른 값으로 overflow 속성을 사용할 경우 새로운 블록 서식 문맥 (block formatting context) 을 생성하게 됩니다. 이 특징은 기술적인 이유로 중요합니다. 만약 스크롤하는 요소와 float이 교차한다면, 각 스크롤 단계마다 내용물을 강제적으로 다시 감싸게 될 것입니다. 이는 결국 스크롤 속도를 느리게 할 것입니다. overflow 속성이 효력을 갖기 위해선, 반드시 블록 레벨 컨테이너의 높이(height 또는 max-height)가 설정되어 있거나, white-space가 nowrap으로 설정되어야 합니다.`

const box = document.querySelectorAll('.box');
for (let i = 0; i < box.length; i++) {
  box[i].textContent = text;
}
              
            
!
999px

Console