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.
<div id="div1">
当春风再一次吹拂她的脸庞时,那场让她刻骨铭心的失恋已在煦风轻扬的季节淡去了。她一点点地恢复,仿佛重生一般,花儿般的笑颜又重新浮上了她的脸庞。而他,看到她康复的样子,高兴极了,但他却不会讲什么,依旧如故,默默地陪在她身旁。他爱她,就包括爱她的一切缺点。这样做,他并不觉得有失尊严。他认为既然爱了,就应该无怨无悔。而她,觉得开始有点喜欢上了他,有些依赖他。但她认为,离爱还很遥远。<br/>
转眼她和他都要毕业了,她甚至没有征求他的意见,就直接去了北方的一座城市,而他,却追随着她也到了这里。本来,在南方那座城市,他的家人早已给他联系好了一家不错的公司,但他连想都没想就拒绝了。她和他分别进了不同的公司。同在一个陌生的城市打工,难免心神俱疲,这个时候,她就很想找一个依靠,给她一点家的温暖。明明知道他一直愿意做她的依靠,可她却不愿意把自己的一生交付于他,因为她觉得自己一直不爱他,不爱,又如何依靠,再说,他也不能提供给她想像中的生活。
</div>
<hr/>
<div id="div2">
当春风再一次吹拂她的脸庞时,那场让她刻骨铭心的失恋已在煦风轻扬的季节淡去了。她一点点地恢复,仿佛重生一般,花儿般的笑颜又重新浮上了她的脸庞。而他,看到她康复的样子,高兴极了,但他却不会讲什么,依旧如故,默默地陪在她身旁。他爱她,就包括爱她的一切缺点。这样做,他并不觉得有失尊严。他认为既然爱了,就应该无怨无悔。而她,觉得开始有点喜欢上了他,有些依赖他。但她认为,离爱还很遥远。<br/>
转眼她和他都要毕业了,她甚至没有征求他的意见,就直接去了北方的一座城市,而他,却追随着她也到了这里。本来,在南方那座城市,他的家人早已给他联系好了一家不错的公司,但他连想都没想就拒绝了。她和他分别进了不同的公司。同在一个陌生的城市打工,难免心神俱疲,这个时候,她就很想找一个依靠,给她一点家的温暖。明明知道他一直愿意做她的依靠,可她却不愿意把自己的一生交付于他,因为她觉得自己一直不爱他,不爱,又如何依靠,再说,他也不能提供给她想像中的生活。
</div>
#div1{
-moz-column-count:2;
-webkit-column-count:2;
}
#div2{
border:6px solid orange;
padding:6px;
text-align:justify;
-moz-column-width:20em;
-moz-column-gap:3em;
-moz-column-rule:6px solid blue;
-webkit-column-width:20em;
-webkit-column-gap:5em;
-webkit-column-rule:6px solid blue;
}
Also see: Tab Triggers