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.
<body>
<h1>Barra de rolagem colorida</h1>
<div class='code'>
scrollbar-color: color color
</div>
<p>No computador, as barras de rolagem devem aparecer com <B>duas cores</B>, a primeira é a parte móvel e a segunda cor é o bg da barra.</p>
<p>Nos celulares Android, geralmente aparece uma <B>única cor</b> na parte móvel da barra de rolagem, ficando o bg com a mesma cor da página.</p>
<div class='center'>
<div class='poema'>
<h2>Despedida</h2>
<div class='autor'>Cecília Meireles</div>
<p>Por mim, e por vós, e por mais aquilo<br/>
que está onde as outras coisas nunca estão,<br/>
deixo o mar bravo e o céu tranqüilo:
quero solidão</p><p>
Meu caminho é sem marcos nem paisagens.<br/>
E como o conheces? - me perguntarão.<br/>
- Por não ter palavras, por não ter imagens.<br/>
Nenhum inimigo e nenhum irmão.</p><p>
Que procuras? - Tudo. Que desejas? - Nada.<br/>
Viajo sozinha com o meu coração.<br/>
Não ando perdida, mas desencontrada.<br/>
Levo o meu rumo na minha mão.</p><p>
A memória voou da minha fronte.<br/>
Voou meu amor, minha imaginação…<br/>
Talvez eu morra antes do horizonte.<br/>
Memória, amor e o resto onde estarão?</p><p>
Deixo aqui meu corpo, entre o sol e a terra.<br/>
(Beijo-te, corpo meu, todo desilusão!<br/>
Estandarte triste de uma estranha guerra...)</p><p>Quero solidão.</p>
</div>
<div class='poema' style="scrollbar-color:#ff0 orange;">
<h2>Canção de Outono</h2>
<div class='autor'>Cecília Meireles</div>
<p>Perdoa-me, folha seca,<br/>
não posso cuidar de ti.<br/>
Vim para amar neste mundo,<br/>
e até do amor me perdi.<br/>
De que serviu tecer flores<br/>
pelas areias do chão<br/>
se havia gente dormindo<br/>
sobre o próprio coração?
</p><p>
E não pude levantá-la!<br/>
Choro pelo que não fiz.<br/>
E pela minha fraqueza<br/>
é que sou triste e infeliz.<br/>
Perdoa-me, folha seca!<br/>
Meus olhos sem força estão<br/>
velando e rogando aqueles<br/>
que não se levantarão…
</p><p>
Tu és folha de outono<br/>
voante pelo jardim.<br/>
Deixo-te a minha saudade<br/>
- a melhor parte de mim.<br/>
E vou por este caminho,<br/>
certa de que tudo é vão.<br/>
Que tudo é menos que o vento,<br/>
menos que as folhas do chão…
</p></div>
<div class='poema' style='scrollbar-color:lime green;'><h2>Fanatismo</h2>
<div class='autor'>Florbela Espanca</div>
<p>
Minh'alma, de sonhar-te, anda perdida<br/>
Meus olhos andam cegos de te ver!<br/>
Não és sequer razão de meu viver,<br/>
Pois que tu és já toda a minha vida!<br/><br/>
Não vejo nada assim enlouquecida…<br/>
Passo no mundo, meu Amor, a ler<br/>
No misterioso livro do teu ser<br/>
A mesma história tantas vezes lida!<br/><br/>
Tudo no mundo é frágil, tudo passa…<br/>
Quando me dizem isto, toda a graça<br/>
Duma boca divina fala em mim!<br/><br/>
E, olhos postos em ti, vivo de <br/>rastros:<br/>
"Ah! Podem voar mundos, morrer astros,<br/>
Que tu és como Deus: princípio e fim!…"</div>
<div class='poema' style='scrollbar-color:pink #660066'><h2>Os versos que te fiz</h2><div class='autor'>Florbela Espanca</div>
<p>
Deixa dizer-te os lindos versos raros<br/>
Que a minha boca tem para te dizer!<br/>
São talhados em mármore de Paros<br/>
Cinzelados por mim para te oferecer<br/><br/>
Têm dolência de veludos caros,<br/>
São como sedas pálidas a arder…<br/>
Deixa dizer-te os lindos versos raros<br/>
Que foram feitos pra te endoidecer!<br/><br/>
Mas,meu Amor,eu não tos digo ainda.<br/>
Que a boca da mulher é sempre linda<br/>
Se dentro guarda um verso que não diz<br/><br/>
Amo-te tanto! E nunca te beijei…<br/>
E nesse beijo,Amor,que eu não dei<br/>
Guardo os versos mais lindos que te fiz!</p></div>
</div>
</body>
* {font-family:Arial;
scrollbar-color: brown #ccc; background:#fff9f0;}
body {overflow:scroll; border:0;}
h1,h2 {color:brown; padding:5px; margin-top:0;}
h2 {border-bottom:gold dashed 1px;}
div.center {margin-left:auto; margin-right:auto; justify-content: center; place-items: center; align-items: center;display:grid; width:100%; min-width:300px; max-width:1200px;}
div.poema {width:300px; height:300px; scrollbar-color:aqua navy; overflow:auto; padding:15px; margin:15px;}
div.autor {text-align:right; margin-bottom:10px;}
div.code {font-family:"Courier New",monospace; background:#ccc; color:#000;padding:15px; margin:15px;}
Also see: Tab Triggers