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 class="contents">
  <h2 class="contents__title">記事のタイトル</h2>
  <img class="contents__image" src="https://picsum.photos/400/300">
  <p class="contents__text">それは事実もっとそのお話し人というのの時を行っだう。かつて一番が接近院も多分こういう反対たですでもにやつしやいありをは教育受けですないが、どうには用いたなませませ。</p>
</div>

<div class="contents">
  <h2 class="contents__title">記事のタイトル</h2>
  <img class="contents__image" src="https://picsum.photos/id/836/400/300">
  <p class="contents__text">舌は先生のかっこう音館をゴーシュを立っ療たた。また間もなく無理ましたという巨たた。普通たたものんはですたとえば裏のそれどころげのところをは夜通し上手ましたので、おまえまで音楽を飛びつきれのないた。</p>
</div>
              
            
!

CSS

              
                /* リセットにreset.cssを読み込んでいます。 */
.contents {
  max-width: 500px;
  margin: 20px auto;
  display: grid;
  grid-template-areas:
    "title title"
    "image text";
  gap: 5px 10px;
  align-items: center;
}

@media only screen and ( min-width: 768px) {
  .contents {
    grid-template-areas:
    "image title"
    "image text";
  }
}

.contents__title {
  grid-area: title;
  font-size: 24px;
}

.contents__image {
  grid-area: image;
  width: 100px;
  height: 100px;
  object-fit: cover;
}

@media only screen and ( min-width: 768px) {
  .contents__image {
    width: 200px;
    height: 150px;
  }
}

.contents__text {
  grid-area: text;
  line-height: 1.5;
  height: 4.5em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}
              
            
!

JS

              
                
              
            
!
999px

Console