HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!--
Code for article:
https://www.liquidlight.co.uk/blog/article/using-vue-router-with-vue-v2-client-side/
-->
<div id="app">
<ul>
<li v-for="person in people">
{{ person.name }}
</li>
</ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
var app = new Vue({
data: {
people: [{"index":0,"guid":"ebee55c4-d685-4d77-a2bb-650283fb8753","picture":"http://placehold.it/32x32","age":20,"eyeColor":"green","name":"Hope Dennis","company":"ZORK","email":"hopedennis@zork.com","address":"127 Wortman Avenue, Corriganville, Marshall Islands, 5960","about":"Labore velit deserunt sunt labore nisi reprehenderit voluptate consequat laboris id minim. Elit tempor occaecat sunt enim irure aliqua eiusmod minim. Ad culpa laborum laborum anim proident duis ullamco. Sit ipsum id esse proident sunt et dolor excepteur Lorem irure anim. Lorem nisi eiusmod pariatur qui duis sint minim dolore.\r\n"},{"index":1,"guid":"c54ac0fd-5288-45e3-afa4-fa30c84a6a68","picture":"http://placehold.it/32x32","age":24,"eyeColor":"blue","name":"Coleen Kidd","company":"AFFLUEX","email":"coleenkidd@affluex.com","address":"138 Kane Place, Lowgap, Northern Mariana Islands, 5687","about":"Nisi quis dolor commodo qui consequat nostrud adipisicing minim aliqua id incididunt aliquip voluptate mollit. Ullamco dolore occaecat cupidatat velit quis. Magna velit anim et irure laboris excepteur ullamco in esse qui culpa ipsum. Veniam fugiat labore duis fugiat cillum cupidatat labore tempor eu cupidatat. Mollit veniam Lorem commodo magna minim labore veniam cillum irure. Deserunt amet deserunt et culpa elit magna ullamco. Occaecat ex esse nostrud ullamco aliquip sint aliqua culpa est ipsum aliqua reprehenderit esse incididunt.\r\n"},{"index":2,"guid":"d0a94124-efb7-4461-8d8d-f20466e7f9dd","picture":"http://placehold.it/32x32","age":26,"eyeColor":"brown","name":"Luella Camacho","company":"TECHMANIA","email":"luellacamacho@techmania.com","address":"615 Calder Place, Lupton, North Dakota, 3244","about":"Anim sint sunt amet labore incididunt cillum magna magna in esse ipsum. In cillum duis id magna minim. Mollit nisi Lorem incididunt enim aute Lorem. Pariatur laborum fugiat proident nulla aliqua laboris exercitation ex aliqua est elit. Voluptate eu incididunt sunt culpa mollit consectetur est voluptate nulla cupidatat nostrud do. Labore nisi aute cillum velit officia id. Incididunt labore in dolor laborum dolore sunt cupidatat.\r\n"},{"index":3,"guid":"b1a82dc0-74ce-4a34-9bc2-0eb0434f8170","picture":"http://placehold.it/32x32","age":35,"eyeColor":"green","name":"Avery Mckenzie","company":"QUOTEZART","email":"averymckenzie@quotezart.com","address":"675 Withers Street, Herlong, New Jersey, 3075","about":"Eu exercitation id incididunt irure ullamco veniam. Cillum eu ullamco dolor magna fugiat amet nulla laboris eiusmod. Dolor nostrud aliquip culpa tempor do quis enim ea esse amet. Tempor sit anim Lorem adipisicing. Voluptate quis labore reprehenderit sint est anim qui sit tempor dolore ullamco.\r\n"},{"index":4,"guid":"20889cdb-ba5d-4eae-a2e3-78347681d9fa","picture":"http://placehold.it/32x32","age":27,"eyeColor":"blue","name":"Clements Mckee","company":"GEOFORMA","email":"clementsmckee@geoforma.com","address":"778 Kensington Walk, Takilma, Massachusetts, 7235","about":"Commodo aliqua veniam Lorem anim. Exercitation in magna excepteur tempor dolore labore sit anim. In anim eu cillum quis occaecat anim enim est nostrud labore sint Lorem do officia. Voluptate adipisicing enim tempor sint anim culpa commodo commodo ullamco sunt ea irure. Ut quis enim occaecat ipsum eu esse qui eiusmod et Lorem sunt officia ad commodo.\r\n"},{"index":5,"guid":"1aa7bab5-026b-426d-ac11-fc34def982d7","picture":"http://placehold.it/32x32","age":28,"eyeColor":"brown","name":"Mcdaniel Justice","company":"QUILCH","email":"mcdanieljustice@quilch.com","address":"839 Billings Place, Whitewater, Florida, 3350","about":"Pariatur et eu dolor labore mollit tempor sunt laborum eiusmod deserunt enim ea eu excepteur. Aliquip id eiusmod dolore qui sit fugiat ut commodo. Ut est in aliquip non. Ut in quis in sunt. Cupidatat amet cupidatat mollit reprehenderit fugiat in duis. Dolore exercitation esse veniam duis velit excepteur mollit.\r\n"},{"index":6,"guid":"655efe68-f26c-4f36-a2bd-cbf4d7929b77","picture":"http://placehold.it/32x32","age":36,"eyeColor":"green","name":"Stone Watkins","company":"ROBOID","email":"stonewatkins@roboid.com","address":"927 Canda Avenue, Beyerville, Maine, 706","about":"Minim officia nisi in cupidatat eu. Veniam laborum aute voluptate officia laboris id reprehenderit. Elit sint do reprehenderit exercitation nostrud nisi.\r\n"}]
}
}).$mount('#app');
Also see: Tab Triggers