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 id="app">
  <main>
    <div v-text='message'></div>
    <div v-html="'&nbsp;&nbsp;&nbsp;&nbsp;啊&nbsp;&nbsp;这里是一段文字并使用Unicode转义的空格;'">
    </div>
    <div v-html="'  这里是一段全角文字,所以开头的空格是可以看到的;'">
    </div>
    <div v-html="'   这里是一段半角文字,所以开始的空格是看不到的;'">
    </div>
    <div style='white-space:pre' v-html="'    这里是用css样式 white-space:pre 来控制开头空格显示;'"></div>
    <pre v-html="'    这里使用 pre 标签来显示开始的空格空格,但是并不推荐。'"></pre>
  </main>
  <div>
    附:&lt;pre&gt; 标签内不能包含 &lt;p&gt; 标签等导致段落断开的标签 <a href="https://www.w3school.com.cn/tags/tag_pre.asp" target="_blank">点击查看<a>
  </div>
</div>

              
            
!

CSS

              
                main
  border 1px solid red
  margin 10px
body
  line-height 2
  font-size 15px
  font-family 'microsoft yahei'
              
            
!

JS

              
                var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  }
})
              
            
!
999px

Console