JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
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.
<p>local 背景相对于元素的内容固定,如果元素可滚动,则背景将会随着元素的内容滚动</p>
<div class="demo local ">
<h3 class="title">将进酒</h3>
<p class="desc">君不见,黄河之水天上来,奔流到海不复回。</p>
<p class="desc">君不见,高堂明镜悲白发,朝如青丝暮成雪。</p>
<p class="desc">人生得意须尽欢,莫使金樽空对月。</p>
<p class="desc">天生我材必有用,千金散尽还复来。</p>
<p class="desc">烹羊宰牛且为乐,会须一饮三百杯。</p>
<p class="desc">岑夫子,丹丘生,将进酒,杯莫停。</p>
<p class="desc">与君歌一曲,请君为我倾耳听。</p>
<p class="desc">钟鼓馔玉不足贵,但愿长醉不复醒。</p>
<p class="desc">古来圣贤皆寂寞,惟有饮者留其名。</p>
<p class="desc">陈王昔时宴平乐,斗酒十千恣欢谑。</p>
<p class="desc">主人何为言少钱,径须沽取对君酌。</p>
<p class="desc">五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。</p>
</div>
<p>scroll 背景相对于元素本身固定,如果元素可滚动,背景不随着内容滚动</p>
<div class="demo scroll">
<h3 class="title">将进酒</h3>
<p class="desc">君不见,黄河之水天上来,奔流到海不复回。</p>
<p class="desc">君不见,高堂明镜悲白发,朝如青丝暮成雪。</p>
<p class="desc">人生得意须尽欢,莫使金樽空对月。</p>
<p class="desc">天生我材必有用,千金散尽还复来。</p>
<p class="desc">烹羊宰牛且为乐,会须一饮三百杯。</p>
<p class="desc">岑夫子,丹丘生,将进酒,杯莫停。</p>
<p class="desc">与君歌一曲,请君为我倾耳听。</p>
<p class="desc">钟鼓馔玉不足贵,但愿长醉不复醒。</p>
<p class="desc">古来圣贤皆寂寞,惟有饮者留其名。</p>
<p class="desc">陈王昔时宴平乐,斗酒十千恣欢谑。</p>
<p class="desc">主人何为言少钱,径须沽取对君酌。</p>
<p class="desc">五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。</p>
</div>
<p>fixed 背景相对于视口固定,如果元素可滚动,背景不随着元素的内容滚动</p>
<div class="demo fixed">
<h3 class="title">将进酒</h3>
<p class="desc">君不见,黄河之水天上来,奔流到海不复回。</p>
<p class="desc">君不见,高堂明镜悲白发,朝如青丝暮成雪。</p>
<p class="desc">人生得意须尽欢,莫使金樽空对月。</p>
<p class="desc">天生我材必有用,千金散尽还复来。</p>
<p class="desc">烹羊宰牛且为乐,会须一饮三百杯。</p>
<p class="desc">岑夫子,丹丘生,将进酒,杯莫停。</p>
<p class="desc">与君歌一曲,请君为我倾耳听。</p>
<p class="desc">钟鼓馔玉不足贵,但愿长醉不复醒。</p>
<p class="desc">古来圣贤皆寂寞,惟有饮者留其名。</p>
<p class="desc">陈王昔时宴平乐,斗酒十千恣欢谑。</p>
<p class="desc">主人何为言少钱,径须沽取对君酌。</p>
<p class="desc">五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。</p>
</div>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.demo {
width: 500px;
height: 320px;
margin: 32px auto;
background: url('http://www.daqianduan.com/wp-content/uploads/2018/11/13bb479bd1c0698968cba60885b6215c.jpg') no-repeat top center;
overflow-y: scroll;
}
.title,
.desc{
text-align: center;
color: #fff;
}
.title {
margin-bottom: 24px;
}
.desc {
margin-bottom: 8px;
}
.local {
background-attachment: local;
}
.scroll {
background-attachment: scroll;
}
.fixed {
background-attachment: fixed;
}
Also see: Tab Triggers