Pen Settings



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


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


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.


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.


                <div class="price-tag">¥99.09</div>


                :root {
  --price-tag-background: red;
  --price-tag-height: 32px;
.price-tag {
  margin-left: 30px;
  position: relative;
  max-width: 80px;
  padding: 0px 5px;
  height: var(--price-tag-height);
  background: var(--price-tag-background);
  color: #fff;
  /* 标签中内容水平垂直居 */
  display: flex;
  align-items: center;
  justify-content: center;
/* 绘制三角形 */
.price-tag::before {
  content: "";
  border: calc(var(--price-tag-height) / 2) solid transparent;
  border-right-color: red;
  /* 控制三角形位置 */
  position: absolute;
  left: 0px;
  top: 0px;
  transform: translate(-100%, 0px); /*水平向左移动自身宽度*/
/* 绘制标签中白色圆点*/
.price-tag::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 9999rem;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%); /*向左和向上移动自身宽度一半*/