Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <h1>:nth-child(n)</h1>
<p>n번째 자식요소 선택. n은 숫자, 홀수(odd), 짝수(even), 수식 가능</p>

<hr>

<style>
  .nc1 p:nth-child(4) {
    color: red;
    font-weight: bold;
  }

  .nc2 div:nth-child(odd) {
    background: gold;
  }
  .nc2 div:nth-child(even) {
    background: gray;
  }

  .nc3 p:nth-child(3n) {
    color: blue;
    font-size: 24px;
    font-weight: bold;
  }

  .nlc1 p:nth-last-child(2) {
    background: #333;
    color: white;
  }
</style>
<h2>:nth-child(n)</h2>
<div class="nc1">
  <p>1번째 자식요소</p>
  <p>2번째 자식요소</p>
  <p>3번째 자식요소</p>
  <p>4번째 자식요소</p>
  <p>5번째 자식요소</p>
</div>

<hr>

<h2>:nth-child(홀수 or 짝수)</h2>
<div class="nc2">
  <div>홀수 칸</div>
  <div>짝수 칸</div>
  <div>홀수 칸</div>
  <div>짝수 칸</div>
  <div>홀수 칸</div>
  <div>짝수 칸</div>
</div>

<hr>

<h2>:nth-child(수식)</h2>
<div class="nc3">
  <p>1번</p>
  <p>2번</p>
  <p>3번</p>
  <p>4번</p>
  <p>5번</p>
  <p>6번</p>
  <p>7번</p>
  <p>8번</p>
  <p>9번</p>
  <p>10번</p>
</div>

<hr style="border-top: 5px solid #333;">

<h1>:nth-last-child(n)</h1>
<p>뒤에서 부터 n번째 자식요소 선택. n은 홀수, 짝수, 수식 가능</p>
<div class="nlc1">
  <p>1번째 요소</p>
  <p>2번째 요소</p>
  <p>3번째 요소</p>
  <p>4번째 요소</p>
  <p>5번째 요소</p>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console