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.
<!--
Artigo : Contraste de cores
Autor : Orivelton Cesar - www.orivelton.com.br
-->
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>Contraste de cores</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="row row-header">
<div class="container">
<nav>
<ul>
<li>
<a href="#content" title="Ir para o Conteúdo">Ir para o Conteúdo</a>
</li>
<li>
<a href="#" title="Ir para o Topo">Ir para o Topo</a>
</li>
<li>
<a href="#footer" title="Ir para o Rodapé">Ir para o Rodapé</a>
</li>
<li>
<a href="#" data-contraste="0" title="Sem Contraste">Sem Contraste</a>
</li>
<li>
<a href="#" data-contraste="1" title="Contraste Branco">Contraste Branco</a>
</li>
<li>
<a href="#" data-contraste="2" title="Contraste Preto">Contraste Preto</a>
</li>
<li>
<a href="#" data-contraste="3" title="Contraste Azul">Contraste Azul</a>
</li>
</ul>
</nav>
</div>
<!-- End - .container-->
</div>
<!-- End - .row-->
<div class="row row-top">
<div class="container">
<strong>Front End Developer</strong>
</div>
</div>
<div class="row row-banner">
<div class="container">
<h1>Hi my names is <span>Orivelton</span></h1>
<img src="https://i.imgur.com/fmY5HzM.png" alt="Avatar Orivelton" class="avatar">
<img src="https://i.imgur.com/3RTGwHr.png" alt="" class="oculos">
</div>
</div>
<div class="row row-content">
<article class="container" id="content">
<div class="box">
<h2>Html5</h2>
<i>★★★★★</i>
<p>
Mussum Ipsum, cacilds vidis litro abertis. Manduma pindureta quium dia nois paga.
Nec orci ornare consequat. Praesent lacinia ultrices consectetur. Sed non ipsum felis.
Si num tem leite então bota uma pinga aí cumpadi! Atirei o pau no gatis, per gatis num morreus.
</p>
</div>
<div class="box">
<h2>Css3</h2>
<i>★★★★★</i>
<p>
Mussum Ipsum, cacilds vidis litro abertis. Manduma pindureta quium dia nois paga.
Nec orci ornare consequat. Praesent lacinia ultrices consectetur. Sed non ipsum felis.
Si num tem leite então bota uma pinga aí cumpadi! Atirei o pau no gatis, per gatis num morreus.
</p>
</div>
<div class="box">
<h2>Javascript</h2>
<i>★★★★</i>
<p>
Mussum Ipsum, cacilds vidis litro abertis. Manduma pindureta quium dia nois paga.
Nec orci ornare consequat. Praesent lacinia ultrices consectetur. Sed non ipsum felis.
Si num tem leite então bota uma pinga aí cumpadi! Atirei o pau no gatis, per gatis num morreus.
</p>
</div>
<div class="box">
<h2>Typescript</h2>
<i>★★★★</i>
<p>
Mussum Ipsum, cacilds vidis litro abertis. Manduma pindureta quium dia nois paga.
Nec orci ornare consequat. Praesent lacinia ultrices consectetur. Sed non ipsum felis.
Si num tem leite então bota uma pinga aí cumpadi! Atirei o pau no gatis, per gatis num morreus.
</p>
</div>
</article>
</div>
<footer id="footer">
Copyright (c) 2016 Copyright Holder All Rights Reserved.
</footer>
<script type="text/javascript" src="js/contraste.js"></script>
</body>
</html>
/*
Artigo : Contraste de cores
Autor : Orivelton Cesar - www.orivelton.com.br
*/
* {margin: 0; padding: 0} img {border : 0}
body {
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
}
/*START - Barra de Acessibilidade*/
.row {
width: 100%;
overflow: hidden;
}
.container {
width: 1024px;
margin: auto;
overflow: hidden;
display: block;
}
.row-header {
background: #282e3a;
position: fixed;
z-index: 1;
top: 0;
}
nav ul li {
float: left;
list-style: none;
}
nav ul li a {
color: #FFFFFF;
display: inline-block;
padding: 17px;
font-size: 11px;
text-transform: uppercase;
}
nav ul li a[data-contraste="0"] {
background: #FFFFFF;
color: #000000;
}
.row-top {
background: #64c4e8;
color: #FFFFFF;
margin-top: 47px;
}
.row-top .container {
padding: 1.5% 0;
text-align: center;
font-size: 1.5em;
}
.row-banner, footer {
background: #56c0e6;
color: #FFFFFF;
text-align: center;
}
.row-banner .container {
padding: 8% 0;
position: relative;
text-align: center;
}
.row-banner .avatar {
border: 5px solid #fff;
border-radius: 50%;
padding: 0.5%;
margin-top: 2%;
}
.oculos {
position: absolute;
top: 49%;
left: 40.7%;
}
.row-banner h1 {
text-transform: uppercase;
}
.row-banner h1 span {
color: #fdf210;
}
.row-content {
background: #282e3a;
color: #fdf210;
}
.row-content .container {
padding: 8% 0;
}
.row-content .box {
width: 46%;
margin: 4% 0;
float: left;
text-align: center;
}
.row-content .box h2 {
padding-bottom: 2%;
text-transform: uppercase;
letter-spacing: 10px;
}
.row-content .box i {
font-style: normal;
color: #fdf210;
font: 1em;
}
.row-content .box p {
color: #FFFFFF;
padding: 2%;
}
footer {
padding: 3% 0;
}
/*START - Contraste Branco*/
#contrasteBranco .row-header,
#contrasteBranco .row-top,
#contrasteBranco .row-banner,
#contrasteBranco .row-content,
#contrasteBranco footer{
border-top: 1px solid #0a0a0a;
background: #FFFFFF;
}
#contrasteBranco nav ul li a,
#contrasteBranco .row-top,
#contrasteBranco .row-banner,
#contrasteBranco .row-content,
#contrasteBranco .row-content .box p,
#contrasteBranco .row-content .box i,
#contrasteBranco .row-banner h1 span,
#contrasteBranco footer {
color: #000000;
}
#contrasteBranco nav ul li a.contraste-active {
color: #FFFFFF;
background: #000000;
}
#contrasteBranco nav ul li a[data-contraste="1"],
#contrastePreto nav ul li a[data-contraste="0"] {
background: #000000;
color: #FFFFFF;
}
#contrasteBranco .row-banner .avatar {
border: 5px solid #000;
}
/*END - Contraste Branco*/
/*START - Contraste Preto*/
#contrastePreto .row-header,
#contrastePreto .row-top,
#contrastePreto .row-banner,
#contrastePreto .row-content,
#contrastePreto footer{
border-top: 1px solid #FFFFFF;
background: #000000;
}
#contrastePreto nav ul li a,
#contrastePreto .row-top,
#contrastePreto .row-banner,
#contrastePreto .row-content,
#contrastePreto .row-content .box p,
#contrastePreto .row-content .box i,
#contrastePreto .row-banner h1 span,
#contrastePreto footer {
color: #FFFFFF;
}
#contrastePreto nav ul li a[data-contraste="2"] {
color: #000000;
background: #FFFFFF;
}
#contrastePreto .row-banner .avatar {
border: 5px solid #FFFFFF;
}
/*END - Contraste Preto*/
/*START - Contraste azul*/
#contrasteAzul .row-header,
#contrasteAzul .row-top,
#contrasteAzul .row-banner,
#contrasteAzul .row-content,
#contrasteAzul footer{
border-top: 1px solid #FFFFFF;
background: #0b325c;
}
#contrasteAzul nav ul li a[data-contraste="0"] {
background: #0b325c;
}
#contrasteAzul nav ul li a[data-contraste="3"] {
background: #FFFFFF;
color: #0b325c;
}
#contrasteAzul nav ul li a,
#contrasteAzul .row-top,
#contrasteAzul .row-banner,
#contrasteAzul .row-content,
#contrasteAzul .row-content .box p,
#contrasteAzul .row-content .box i,
#contrasteAzul .row-banner h1 span,
#contrasteAzul footer {
color: #FFFFFF;
}
#contrasteAzul nav ul li a.contraste-active {
color: #0b325c;
background: #FFFFFF;
}
#contrasteAzul .row-banner .avatar {
border: 5px solid #FFFFFF;
}
/*END - Contraste azul*/
/*
Artigo : Contraste de cores
Autor : Orivelton Cesar - www.orivelton.com.br
*/
//Selecionando os links de contraste
var linksContraste = document.querySelectorAll('nav a[data-contraste]');
//Function click passando o valor do data-contraste para a function contraste setar o Id no body
linksContraste.forEach(linksContraste => linksContraste.addEventListener('click', function() {
var dataContraste = this.dataset.contraste; // pegando o data-contraste da tag 'a'
contraste(dataContraste); // Chamando a function contraste com um parâmetro passado pelo data-contraste da tag 'a'
}
));
function contraste(dataContraste) {
var setId;
//Verificação de qual contraste foi selecionado
if (dataContraste == 1) {
setId = 'contrasteBranco';
} else if (dataContraste == 2) {
setId = 'contrastePreto';
} else if (dataContraste == 3) {
setId = 'contrasteAzul';
} else {
setId = ''
}
// setando o ID do contraste escolhido no body
document.querySelector("body").setAttribute("id", setId);
// Guardando o cookie do contraste
document.cookie = "contraste=" + setId + "";
}
// Verificação do cookie
var cookieContrasteBranco = document.cookie.indexOf('contrasteBranco');
var cookieContrastePreto = document.cookie.indexOf('contrastePreto');
var cookieContrasteAzul = document.cookie.indexOf('contrasteAzul');
//Verificando o cookie setado anteriormente
var cookieTrue = '';
if (cookieContrasteBranco != -1) {
cookieTrue = 1;
} else if (cookieContrastePreto != -1) {
cookieTrue = 2;
} else if (cookieContrasteAzul != -1) {
cookieTrue = 3;
} else {
cookieTrue = '';
}
//Chamando a function contraste com o valor do cookie guardado
contraste(cookieTrue);
Also see: Tab Triggers