Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div id="background"></div>

<script src="https://unpkg.com/vue/dist/vue.js"></script>

<div id="vue">
  <div v-html="html"></div>
  <button v-on:click="sayHello">Try me</button>
              @import url('https://fonts.googleapis.com/css?family=Ubuntu');

body {
  margin: 0;
  position: absolute;
  height: 700px;
  width: 100%;
  font-family: ubuntu;

#background {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url(https://cdnsite2.assist.ro/sites/all/themes/assist/img/backgrounds/testimonials_bg.png) repeat;
  background-color: #095396;


#vue {
  margin: auto;
  margin-top: 128px;
  width: 300px;
  height: 326px;
  padding: 54px 36px 112px;
  background-color: whitesmoke;
  text-align: center;
  border: 1px solid white;
  border-radius: 16px;
  box-shadow: 0 4px 64px white;

#vue h1 {
  text-shadow: 0 1px 6px cyan;

#vue p#darkblue {
  margin-top: 42px;
  margin-bottom: 24px;
  text-shadow: 0 0 60px darkblue;

#vue #bar {
  margin-top: 38px;
  margin-bottom: 40px;
  height: 1px;
  background-color: black

#vue label {
  display: block;
  margin-bottom: 32px;
  font-weight: bold;
  text-align: center

#vue input {
  width: 200px;
  padding: 4px;
  border: 2px solid darkblue;
  border-radius: 8px;

#vue button {
  cursor: pointer;
              //the following two blocks of code are components
//we'll use them to make custom html elements

Vue.component("hello", {
  template: "<label>Input Your Name:<h1></h1><input/></label>"

Vue.component("bar", {
  template: "<div id='bar'></div>"

//next we'll select an element
//set up data
//and define a method

new Vue({
  el: "#vue",
  data: {
    text: "Simple Vue App.",
    html: "<p id='darkblue'>You can use Vue to do<br/>all kinds of cool stuff!</p>"
  methods: {
    sayHello: function() {
      var name = document.querySelector("#vue input"),
        button = document.querySelector("#vue button"),
        prompt = "What's your name?";
      var style = name.style;

      if (!name.value || name.value === prompt) {
        name.value = prompt;
      } else {
        alert("Howdy " + name.value + "!");
        name.value = null;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.