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.
<HTML>
<body>
<div class="scroll-top-wrapper ">
<span class="scroll-top-inner">
<i class="fa fa-2x fa-arrow-circle-up"></i>
</span>
</div>
<div class="container">
<h1>Cara Membuat Tombol Back to Top di Blogger</h1>
<span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sed pretium elit, id varius eros. Phasellus rutrum ligula risus, eget ornare quam faucibus ut. Pellentesque cursus porta ligula, eget pellentesque erat feugiat vestibulum. In odio ante, gravida nec arcu a, luctus euismod erat. Nam eu mattis nisl. Duis porta sapien at dapibus porttitor. Duis ullamcorper lectus a vehicula auctor. Vestibulum in pretium nibh. Maecenas mi dui, sollicitudin ut sem eu, congue mollis lacus.
</br> </br>
Praesent fermentum eros quam, sit amet facilisis neque auctor sagittis. Etiam lacinia purus quis ex commodo, nec faucibus enim lobortis. Fusce libero lacus, porta id urna vel, viverra placerat eros. In commodo sed libero ut interdum. In iaculis augue eu diam varius, quis venenatis ipsum placerat. Duis ac dignissim lectus. Donec porttitor at sem non condimentum. Suspendisse potenti. Etiam semper ex eu risus dictum vulputate. Aenean mollis dolor tellus, rutrum egestas nisi congue ac.
</br> </br>
Fusce et sem vel nulla viverra suscipit. Praesent suscipit sem luctus, fringilla turpis non, scelerisque risus. Nulla sed venenatis purus. Ut suscipit luctus enim, a iaculis ipsum congue a. Etiam sed quam purus. Phasellus vel massa maximus, mollis neque sit amet, fermentum urna. Donec tincidunt augue ut posuere blandit. Aliquam massa nibh, tristique at ex sed, sagittis tincidunt nisi. Maecenas sollicitudin dapibus imperdiet. Quisque odio felis, ullamcorper consequat sapien nec, gravida dapibus sem.
</br> </br>
Sed vestibulum ultrices sapien sed ultricies. Ut egestas, ex vel ultrices auctor, augue massa tristique ante, ac tempor est urna quis nisi. Aenean vehicula risus vel odio pulvinar, sed ornare mauris commodo. Maecenas dapibus magna urna, sit amet pretium nisl maximus eget. Donec sit amet lacus ligula. Nunc fermentum lectus at ornare elementum. Praesent eget odio at libero facilisis tempus semper eget leo. Proin quis efficitur arcu. Praesent pellentesque enim ut ornare condimentum. In finibus convallis risus. Ut eu tempor metus. Fusce sollicitudin dignissim enim vel tincidunt. Etiam pharetra magna vel ornare facilisis. Etiam dignissim non magna a laoreet. Aenean id metus nibh. Nam ut iaculis nisi.
</br> </br>
Suspendisse ultricies non neque ac elementum. Fusce dictum, neque eget posuere pharetra, nisi leo tincidunt felis, ut mollis lacus dui vitae ex. Morbi ultrices sapien non nisi ornare luctus. Aliquam congue, quam ut blandit cursus, leo purus auctor nibh, id dictum est enim non quam. In tempor urna sed tempus ultrices. Suspendisse pretium tellus nec maximus dignissim. Cras congue justo mollis ex posuere, vitae efficitur libero mattis. Mauris condimentum justo eget ex molestie, a pulvinar tortor dignissim. Mauris vulputate viverra erat vitae molestie. Maecenas pulvinar dolor vitae lorem fringilla sodales. Sed consequat finibus mi, at pellentesque nisi. Pellentesque quis nisl sit amet nulla lobortis porta eu in nulla.
</br> </br>
Sed vestibulum ultrices sapien sed ultricies. Ut egestas, ex vel ultrices auctor, augue massa tristique ante, ac tempor est urna quis nisi. Aenean vehicula risus vel odio pulvinar, sed ornare mauris commodo. Maecenas dapibus magna urna, sit amet pretium nisl maximus eget. Donec sit amet lacus ligula. Nunc fermentum lectus at ornare elementum. Praesent eget odio at libero facilisis tempus semper eget leo. Proin quis efficitur arcu. Praesent pellentesque enim ut ornare condimentum. In finibus convallis risus. Ut eu tempor metus. Fusce sollicitudin dignissim enim vel tincidunt. Etiam pharetra magna vel ornare facilisis. Etiam dignissim non magna a laoreet. Aenean id metus nibh. Nam ut iaculis nisi.
</br> </br>
Praesent fermentum eros quam, sit amet facilisis neque auctor sagittis. Etiam lacinia purus quis ex commodo, nec faucibus enim lobortis. Fusce libero lacus, porta id urna vel, viverra placerat eros. In commodo sed libero ut interdum. In iaculis augue eu diam varius, quis venenatis ipsum placerat. Duis ac dignissim lectus. Donec porttitor at sem non condimentum. Suspendisse potenti. Etiam semper ex eu risus dictum vulputate. Aenean mollis dolor tellus, rutrum egestas nisi congue ac.</p>
</span>
</div>
</body>
</HTML>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
body {
background: #f1f1f1 none repeat scroll top left;
font-family: 'Open Sans', sans-serif;
margin: 0;
padding: 0;
position: relative;
line-height: normal;
}
a,
a:visited {
color: #555;
outline: none;
text-decoration: none;
}
a:hover,
a:focus,
a:visited:hover {
color: #22a1c4;
text-decoration: none;
}
.container {
max-width: 768px;
margin: 1% auto;
padding: 30px;
background: #fff;
color: #95a5a6;
font-family: 'Open Sans', sans-serif;
font-size: 1em;
line-height: normal;
}
.container h1,
.container h2 {
display: block;
text-align: center;
margin-bottom: 30px;
font-size: 2em;
font-weight: 700;
color: #336699;
}
.container h2 {
margin-top: 30px;
}
/* Back To Top */
.scroll-top-wrapper {
position: fixed;
opacity: 0;
visibility: hidden;
overflow: hidden;
text-align: center;
z-index: 99999999;
background-color: #777777;
color: #eeeeee;
width: 50px;
height: 48px;
line-height: 48px;
right: 30px;
bottom: 30px;
padding-top: 2px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.scroll-top-wrapper:hover {
background-color: #888888;
}
.scroll-top-wrapper.show {
visibility:visible;
cursor:pointer;
opacity: 1.0;
}
.scroll-top-wrapper i.fa {
line-height: inherit;
}
$(function(){
$(document).on( 'scroll', function(){
if ($(window).scrollTop() > 100) {
$('.scroll-top-wrapper').addClass('show');
} else {
$('.scroll-top-wrapper').removeClass('show');
}
});
$('.scroll-top-wrapper').on('click', scrollToTop);
});
function scrollToTop() {
verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
element = $('body');
offset = element.offset();
offsetTop = offset.top;
$('html, body').animate({scrollTop: offsetTop}, 500, 'linear');
}
Also see: Tab Triggers