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

              
                <div>
  
  <article>
    <h1>List of Current NBA Teams</h1>
    <p>
      There are 30 teams in the NBA and they are divided equally with 15 teams into different conferences. Each conference is made up of three divisions with five teams in each group. Check out the list below to locate your favorite NBA team to bet on when basketball season is underway.
    </p>
    <p>
      Each NBA team has fifteen players. Twelve players are considered part of the active roster and can dress out to play in a game. The other three are inactive or in reserve. Five players play per team at a time. There aren't any special positions by rule in the NBA. Positions are more through different roles played on the court as set up by the coach.
    </p>
    <strong class="label"><span>&#8675;</span>Scroll Down to See the List<span>&#8675;</span></strong>
  </article>
  
  <section>
    <h2 class="first">
      <span class="title">
        <span>
          Eastern Conference
        </span>
      </span>
    </h2>

    <section>
      <h3>
        <span class="title">
          <span>
            Atlantic Division
          </span>
        </span>
      </h3>
      <ul>
        <li>Boston Celtics</li>
        <li>Brooklyn Nets</li>
        <li>New York Knicks</li>
        <li>Philadelphia 76ers</li>
        <li>Toronto Raptors</li>
      </ul>
    </section>

    <section>
      <h3>
        <span class="title">
          <span>
            Central Division
          </span>
        </span>
      </h3>
      <ul>
        <li>Chicago Bulls</li>
        <li>Cleveland Cavaliers</li>
        <li>Detroit Pistons</li>
        <li>Indiana Pacers</li>
        <li>Milwaukee Bucks</li>
      </ul>
    </section>

    <section>
      <h3>
        <span class="title">
          <span>
            Southeast Division
          </span>
        </span>  
      </h3>
      <ul>
        <li>Atlanta Hawks</li>
        <li>Charlotte Hornets</li>
        <li>Miami Heat</li>
        <li>Orlando Magic</li>
        <li>Washington Wizards</li>
      </ul>
    </section>
    
  </section>

  <section>
    <h2>
      <span class="title">
        <span>
          Western Conference
        </span>
      </span>
    </h2>

    <section>
      <h3>
        <span class="title">
          <span>
            Northwest Division
          </span>
        </span>    
      </h3>
      <ul>
        <li>Denver Nuggets</li>
        <li>Minnesota Timberwolves</li>
        <li>Oklahoma City Thunder</li>
        <li>Portland Trail Blazers</li>
        <li>Portland Trail Blazers</li>
      </ul>
    </section>

    <section>
      <h3>
        <span class="title">
          <span>
            Pacific Division
          </span>
        </span>
      </h3>
      <ul>
        <li>Golden State Warriors</li>
        <li>Los Angeles Clippers</li>
        <li>Los Angeles Lakers</li>
        <li>Phoenix Suns</li>
        <li>Sacramento Kings</li>
      </ul>
    </section>

    <section>
      <h3>
        <span class="title">
          <span>
            Southwest Division
          </span>
        </span>
      </h3>
      <ul>
        <li>Dallas Mavericks</li>
        <li>Houston Rockets</li>
        <li>Memphis Grizzlies</li>
        <li>New Orleans Pelicans</li>
        <li>San Antonio Spurs</li>
      </ul>
    </section>
    
  </section>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

html {
  font-family: Arial, Helvetica, sans-serif;
  color: #777;
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  margin: 0;
  height: 100%;
}

div {
  border: solid 1px #ccc;
  height: var(--height);
  width: 90vw;
  overflow-y: auto;
  overflow-x: hidden;
  
  --height: 500px;
}

article {
  padding: 1.25em;
  position: relative;
  min-height: var(--height);
}

.label {
  align-items: center;
  bottom: 1em;
  color: #ff495d;
  display: flex;
  gap: 0.25em;
  justify-content: center;
  position: absolute;
  left: 0;
  right: 0;
}

.label span {
  font-size: 125%;
}

section {
  position: relative;
}

section:last-of-type section:last-of-type {
  min-height: var(--height);
}

h1 {
  color: #333;
}

p {
  font-size: 18px;
  line-height: 1.5;
}

h2, h3 {
  color: white;
  display: flex;
  font-size: 1.5em;
  margin: 0;
  position: sticky;
  top: 0;
}

h2::before, h3::before {
  background: #ccc;
  content: '';
  height: 1px;
  position: absolute;
  width: 100%;
}

h2 {
  justify-content: flex-end;
  margin-bottom: 0.25rem;
  z-index: 2;
}

h2::before {
  right: 0;
  top: 0;
}

h3 {
  z-index: 1;
}

h3::before {
  left: 0;
  bottom: 0;
}

.title {
  align-items: center;
  display: flex;
  font-size: 85%;
  height: 50px;
  padding-inline: 0.5em;
  min-width: calc(50% - 2px);
}

h2 .title {
  background-color: #6244b0;
  transform-origin: right;
}

h3 .title {
  background-color: #3dc0d1;
  transform-origin: left;
}

ul {
  list-style: none;
  margin: 0;
  font-size: 18px;
  padding: 0 0.25rem;
}

li {
  background-color: rgba(0, 0, 0, 0.05);
  line-height: 1.5;
  margin-block: 0.25rem;
  padding: 0.75em 1em;
  transform-origin: left;
}
              
            
!

JS

              
                
              
            
!
999px

Console