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="title">::after , ::before</div>
<div class="beforeAfter">Lines are created using before and after pseudo elements</div>
<div class="before">Black box inserted using before.</div>
<div class="after">Black box inserted using after.</div>

<div class="title">::first-letter</div>
<div class="firstLetter">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil, sed. Voluptates cumque accusantium labore fugiat. Accusantium libero consectetur necessitatibus perspiciatis!</div>
<div class="firstLetter2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil, sed. Voluptates cumque accusantium labore fugiat. Accusantium libero consectetur necessitatibus perspiciatis!</div>

<div class="title">::first-line</div>
<div class="firstLine">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Sunt omnis explicabo fuga voluptates recusandae repellendus a praesentium nulla! Non suscipit quidem nulla eos dolorem esse asperiores nesciunt modi, eaque voluptas qui ea praesentium temporibus sed nam? Omnis at maiores quaerat animi pariatur quia. Ab cupiditate nulla et, quos repellat sunt?</div>

<div class="title">::selection</div>
<div class="selection1">Select text using mouse to see the styling done using the ::selection pseudo element. consectetur, adipisicing elit. </div>
<div class="selection2">Select text using mouse to see the styling done using the ::selection pseudo element. consectetur, adipisicing elit. </div>
<div class="selection3">Select text using mouse to see the styling done using the ::selection pseudo element. consectetur, adipisicing elit. </div>
<div class="selection4">Select text using mouse to see the styling done using the ::selection pseudo element. consectetur, adipisicing elit. </div>

<div class="title">::marker</div>
<ul class="marker1">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</ul>

<ul class="marker2">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</ul>

<ul class="marker3">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</ul>

<div class="title">::placeholder</div>
<input type="text" class="text1" placeholder="this is styled with ::placeholder">
<input type="text" class="text2" placeholder="this is styled with ::placeholder">
<input type="text" class="text3" placeholder="this is styled with ::placeholder">
              
            
!

CSS

              
                body {
  max-width: 600px;
  margin: 0 auto;
  margin-top: 50px;
  font-size: 18px;
}

body > * {
  margin-bottom: 20px;
}

.title {
  font-size: 30px;
  margin: 40px 0 20px;
  color: skyblue;
  font-weight: 600;
}
/*  */

.beforeAfter {
  position: relative;
}

.beforeAfter::before,
.beforeAfter::after {
  position: absolute;
  content: "";
  width: 20%;
  height: 2px;
}

.beforeAfter::before {
  background: #0ff;
}

.beforeAfter::after {
  right: 190px;
  bottom: 0px;
  background: #f0f;
}

.before {
  position: relative;
}

.before::before {
  display: inline-block;
  content: "";
  background: #000;
  height: 10px;
  width: 10px;
  left: -20px;
  position: absolute;
}

.after {
  position: relative;
}

.after::after {
  display: inline-block;
  content: "";
  background: #000;
  height: 10px;
  width: 10px;
  right: 350px;
  position: absolute;
}

.firstLetter::first-letter {
  font-size: 30px;
  font-weight: 600;
  color: #fff;
  border: 2px dashed #fff;
  margin-right: 5px;
  padding: 2px 8px;
  background: #000;
}

.firstLetter2::first-letter {
  font-size: 35px;
  color: blue;
  padding: 2px 10px;
  margin-right: 20px;
  background: #0f0;
  border-radius: 5px;
  box-shadow: 2px 2px 5px #000;
}

.firstLine::first-line {
  font-size: 24px;
  color: #fff;
  background: #f20;
  text-shadow: 1px 1px 1px #000;
  text-transform: capitalize;
  text-decoration: line-through;
  text-decoration-color: green;
}

.selection1::selection {
  color: #fff;
  background: green;
}

.selection2::selection {
  color: #fff;
  background: #ddd;
  text-shadow: 1px 1px 0px #000;
}

.selection3::selection {
  color: #2e2;
  background: #000;
}

.selection4::selection {
  background: green;
}

.marker1 ::marker {
  color: red;
  font-size: 20px;
}

.marker2 li::marker {
  color: green;
  line-height: 50px;
  content: "\01F970";
}

.marker3 ::marker {
  color: blue;
  line-height: 50px;
}

input {
  width: 200px;
  padding: 3px 6px;
}

.text1::placeholder {
  color: #0f0;
  background: #333;
}

.text2::placeholder {
  color: #f00;
  text-decoration: line-through;
}

.text3::placeholder {
  font-size: 10px;
  text-transform: uppercase;
  padding-left: 10px;
}

              
            
!

JS

              
                
              
            
!
999px

Console