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="main-container">
 <header class="header">
  <img loading="lazy" srcset="https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=100 100w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=200 200w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=400 400w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=800 800w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=1200 1200w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=1600 1600w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&width=2000 2000w, https://cdn.builder.io/api/v1/image/assets/TEMP/1c93112ad78ac5c82203ca0e31f9e7c4c594bc2ba2c5935d85c3634c2f9ccca5?apiKey=85240bc424d441a2819bd566dfa5305b&" class="image" />
  <h1 class="title">Blog Post Title</h1>
  <blockquote>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</blockquote>
  <div class="meta-data">Written by John Doe on October 10, 2022</div>
 </header>
 <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In hac habitasse platea dictumst. Nulla facilisi. Phasellus a rhoncus orci, eget varius lectus. Donec vel eros sed lacus laoreet elementum eu a justo. Nullam eu tempor enim. Curabitur feugiat ex in nunc facilisis fringilla. Aliquam gravida est eu euismod facilisis. Morbi ultricies fermentum dui nec dignissim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse platea dictumst. Sed non felis mattis, venenatis mi sed, congue risus. Nulla eget massa non augue sodales tincidunt ac at erat. Maecenas dignissim neque auctor varius viverra. Donec tempor ex sed lectus pulvinar suscipit. Curabitur at mauris mi. Sed sem felis, dapibus vel urna a, egestas mollis urna. Proin nec arcu auctor, ultricies lectus nec, tempus metus.
 </p>
 <a href="#" class="read-more">Read More</a>
</div>
              
            
!

CSS

              
                .main-container {
 background-color: #f1f1f1;
 display: flex;
 flex-direction: column;
 justify-content: center;
 padding: 8px;
}

.header {
 display: flex;
 flex-direction: column;
 padding: 40px 49px;
}

@media (max-width: 991px) {
 .header {
  max-width: 100%;
  padding: 0 20px;
 }
}

.image {
 aspect-ratio: 1;
 object-fit: contain;
 object-position: center;
 width: 800px;
 overflow: hidden;
 align-self: center;
 max-width: 100%;
}

.title {
 color: #000;
 text-align: center;
 align-self: center;
 margin-top: 65px;
 white-space: nowrap;
 font: 400 24px Arial, sans-serif;
}

@media (max-width: 991px) {
 .title {
  margin-top: 40px;
  white-space: initial;
 }
}

.meta-data {
 color: #666;
 text-align: center;
 align-self: center;
 margin-top: 40px;
 white-space: nowrap;
 font: 400 15px Arial, sans-serif;
}

@media (max-width: 991px) {
 .meta-data {
  white-space: initial;
 }
}

.description {
 color: #000;
 text-align: center;
 align-self: stretch;
 margin-top: 67px;
 font: 400 16px/26px Arial, sans-serif;
}

@media (max-width: 991px) {
 .description {
  max-width: 100%;
  margin-top: 40px;
 }
}

.read-more {
 color: #fff;
 text-align: center;
 white-space: nowrap;
 border-radius: 4px;
 background-color: #333;
 align-self: center;
 margin-top: 40px;
 justify-content: center;
 padding: 20px 54px;
 font: 400 15px Arial, sans-serif;
}

@media (max-width: 991px) {
 .read-more {
  white-space: initial;
  padding: 0 20px;
 }
}

.header:not(:has(h2)) {
 background-color: lightpink;
}

.subtitle, blockquote {
 text-align: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console