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 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.
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.
If the stylesheet 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 CSS 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.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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 lang="es">
<meta charset="utf8";
<head>
<title>Linea horizontal de progreso de página javascript</title>
<link href="style.css" rel="stylesheet" media="screen">
<!-- Jquery -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<div><a target="_blank" class="desarrollofrontend" href="https://www.desarrollofrontend.com">desarrollofrontend.com</a></div>
<div class="title">
<h1><strong>Linea horizontal de progreso de página javascript</strong> v.1</h1>
</div>
<div class="container_line--charge">
<div class="line"></div>
</div>
<div id="container_post">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dapibus quam ligula, id lobortis urna porta in. Nullam eget lectus mattis, tincidunt ex et, volutpat est. Nullam interdum ut dolor at tempus. Cras finibus purus et leo lacinia laoreet. Aliquam consequat tincidunt tellus, eget dictum libero ultrices at. Mauris blandit, dolor sed rutrum tempor, turpis urna varius turpis, ac molestie turpis ex at dolor. Aliquam erat volutpat. Nunc ac erat sit amet urna vestibulum aliquam.
Nunc in est pulvinar, eleifend nisl non, iaculis nibh. Nulla nec finibus nibh. Sed aliquam volutpat accumsan. Aenean mollis metus sit amet nulla varius lobortis. Suspendisse sagittis nulla turpis, at tempus urna finibus eget. Sed sit amet dolor lorem. Morbi tortor nisl, pharetra sit amet varius sit amet, mattis quis odio. Vivamus vitae nisl vitae risus dignissim efficitur et eget odio.
Integer massa libero, viverra eu sollicitudin quis, egestas non dolor. Fusce pellentesque vehicula nunc a malesuada. Vivamus sollicitudin erat nulla, eu molestie odio mattis placerat. Vestibulum porta arcu eget enim dictum, non efficitur libero ullamcorper. Nam finibus nunc id risus pellentesque malesuada. Donec nulla est, vehicula sit amet urna et, mattis sollicitudin ex. Quisque volutpat ultricies dui, sit amet eleifend felis molestie id. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla vitae erat tortor. Vivamus mattis facilisis dolor sit amet egestas. Nunc in nisi arcu. Phasellus non lacinia lacus. Integer dapibus mi massa, non luctus magna porttitor eget. Donec a dolor at augue eleifend faucibus. Sed at malesuada odio. Nam pretium ante efficitur gravida luctus. Maecenas massa erat, fringilla non dapibus pellentesque, malesuada vel leo. Maecenas at hendrerit lacus. Curabitur et augue feugiat, auctor ligula sit amet, tristique risus.
Etiam elementum turpis sapien, sed finibus sapien accumsan a. Mauris dictum condimentum mi ac vehicula. Morbi est diam, accumsan eu ipsum quis, iaculis venenatis urna. Nulla enim arcu, tincidunt eu luctus ac, tempus non arcu. Duis non turpis urna. Nulla tellus tortor, auctor vitae luctus vel, vulputate vitae erat. Etiam lacinia vitae magna non tincidunt. Aenean id massa non mauris lacinia vestibulum eu vel mi. Aenean eu risus ante. In hac habitasse platea dictumst. Morbi suscipit, velit et vulputate bibendum, tortor lorem vulputate tortor, at accumsan lectus lorem sed nulla.
Nunc porta molestie lacus in porta. Nam in dui eu risus blandit efficitur. Morbi semper ultricies nisl sit amet euismod. Praesent ut orci nisi. Donec ut justo ac lacus iaculis pellentesque lobortis nec tortor. Maecenas cursus nisl urna, eget varius ligula tincidunt at. Donec in commodo magna. Etiam ut tellus quis mauris bibendum tincidunt sed non purus. Sed egestas, elit ut gravida dictum, ante mauris euismod dui, vitae dignissim dolor nibh at metus. In viverra interdum massa non dictum. Sed non augue tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc eu dictum nulla. Pellentesque pharetra id tellus semper gravida.
Aliquam et ligula vitae arcu viverra auctor sed ac lorem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque suscipit eu urna at ullamcorper. Ut nec rhoncus dui, ac lacinia nisi. Ut ac odio faucibus, vehicula ligula nec, dapibus orci. Morbi fermentum lacus nunc, a molestie nisl tristique et. Morbi aliquet, nunc ac tincidunt tincidunt, sapien eros elementum lectus, quis sollicitudin lectus lorem congue orci. Pellentesque eu sagittis dui, sit amet feugiat nisl. Integer porttitor ex ut dui venenatis egestas.
Integer interdum orci eu neque sagittis, in volutpat ligula ornare. Fusce hendrerit bibendum egestas. Integer condimentum tempor enim vitae posuere. Vestibulum purus tellus, gravida sit amet leo sed, scelerisque molestie urna. Vestibulum lorem lorem, ultricies eget ante eu, hendrerit tincidunt enim. Sed euismod ligula egestas pulvinar finibus. Vivamus ac nibh eget orci auctor aliquet. Pellentesque auctor neque id nisl pulvinar ultrices. Nulla facilisi. Nam sit amet elit vulputate, faucibus tortor in, posuere arcu.
Nullam in sapien odio. Suspendisse potenti. Nunc pulvinar lectus id gravida mattis. Praesent semper ac enim ut interdum. Proin quis suscipit massa. Proin posuere libero at leo iaculis ultrices. Suspendisse convallis mauris sit amet eros laoreet aliquet. Ut bibendum dolor nec orci convallis aliquet.
Aenean a felis urna. Proin id dictum purus. Pellentesque eu odio eu arcu consequat dapibus eget sed ligula. Sed imperdiet gravida nulla. In ipsum mi, molestie in eros a, semper viverra est. Phasellus convallis nec risus in aliquam. Nulla eget libero mi. In pulvinar ex at sapien venenatis, vel vulputate velit suscipit. Fusce quis tellus a ipsum pellentesque condimentum. Nam pretium sapien dui, nec mollis orci porttitor vitae.
Nunc porta molestie lacus in porta. Nam in dui eu risus blandit efficitur. Morbi semper ultricies nisl sit amet euismod. Praesent ut orci nisi. Donec ut justo ac lacus iaculis pellentesque lobortis nec tortor. Maecenas cursus nisl urna, eget varius ligula tincidunt at. Donec in commodo magna. Etiam ut tellus quis mauris bibendum tincidunt sed non purus. Sed egestas, elit ut gravida dictum, ante mauris euismod dui, vitae dignissim dolor nibh at metus. In viverra interdum massa non dictum. Sed non augue tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc eu dictum nulla. Pellentesque pharetra id tellus semper gravida.
Aliquam et ligula vitae arcu viverra auctor sed ac lorem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque suscipit eu urna at ullamcorper. Ut nec rhoncus dui, ac lacinia nisi. Ut ac odio faucibus, vehicula ligula nec, dapibus orci. Morbi fermentum lacus nunc, a molestie nisl tristique et. Morbi aliquet, nunc ac tincidunt tincidunt, sapien eros elementum lectus, quis sollicitudin lectus lorem congue orci. Pellentesque eu sagittis dui, sit amet feugiat nisl. Integer porttitor ex ut dui venenatis egestas.
Integer interdum orci eu neque sagittis, in volutpat ligula ornare. Fusce hendrerit bibendum egestas. Integer condimentum tempor enim vitae posuere. Vestibulum purus tellus, gravida sit amet leo sed, scelerisque molestie urna. Vestibulum lorem lorem, ultricies eget ante eu, hendrerit tincidunt enim. Sed euismod ligula egestas pulvinar finibus. Vivamus ac nibh eget orci auctor aliquet. Pellentesque auctor neque id nisl pulvinar ultrices. Nulla facilisi. Nam sit amet elit vulputate, faucibus tortor in, posuere arcu.
Nullam in sapien odio. Suspendisse potenti. Nunc pulvinar lectus id gravida mattis. Praesent semper ac enim ut interdum. Proin quis suscipit massa. Proin posuere libero at leo iaculis ultrices. Suspendisse convallis mauris sit amet eros laoreet aliquet. Ut bibendum dolor nec orci convallis aliquet.
Aenean a felis urna. Proin id dictum purus. Pellentesque eu odio eu arcu consequat dapibus eget sed ligula. Sed imperdiet gravida nulla. In ipsum mi, molestie in eros a, semper viverra est. Phasellus convallis nec risus in aliquam. Nulla eget libero mi. In pulvinar ex at sapien venenatis, vel vulputate velit suscipit. Fusce quis tellus a ipsum pellentesque condimentum. Nam pretium sapien dui, nec mollis orci porttitor vitae.
</div>
<footer>
Footer
</footer>
</body>
</html>
@import url("https://fonts.googleapis.com/css?family=Open+Sans");
html, body {
font-family: 'Open Sans', sans-serif;
margin: 0px;
text-align: center; }
.title {
padding: 10px 20px; }
.container_line--charge {
background-color: white;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
position: fixed;
z-index: 100;
top: 0px;
left: 0px;
width: 100%; }
.container_line--charge .line {
background-color: #0d9ddb;
height: 100%;
min-height: 5px;
box-shadow: 2px 1px 5px -2px rgba(0, 0, 0, 0.75); }
#container_post {
margin: 0px auto;
padding: 10px 20px;
text-align: justify;
line-height: 1.7em;
width: 100%;
max-width: 750px;
padding-bottom: 20px;
margin-bottom: 50px; }
footer {
background-color: #333333;
height: 450px;
max-width: 100%;
color: white;
font-size: 3em;
padding: 20px;
margin: 0px; }
.desarrollofrontend{
color: white;
background-color:#0d9ddb;
text-decoration-line: none;
padding:10px;
display:inline-block;
}
$(document).ready(function() {
$(function () {
var $win = $(window);
});
$(window).scroll(function() {
var alto_ventana = $(window).height();
var posicion_paginaTop = document.body.scrollTop;
var tamano_body = document.body.offsetHeight;
if (posicion_paginaTop>=alto_ventana){
var porciento = (((posicion_paginaTop+alto_ventana) * 100)/tamano_body).toFixed(2);
}if (posicion_paginaTop<=alto_ventana){
var porciento = (((posicion_paginaTop*2) * 100)/tamano_body).toFixed(2);
}
//////
var ancho_px_max = $(".container_line--charge").width();
var ancho_px = (((ancho_px_max * porciento)/100)).toFixed(2);
////
var px_ancho_linea = ((ancho_px * porciento)/100).toFixed(2);
$(".container_line--charge .line").width(px_ancho_linea);
});//scroll
});//fin de la funcion ready
Also see: Tab Triggers