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.
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Especialista em contabilidade em Bauru, SP. Oferecemos soluções completas para empresas e empreendedores. Acesse www.contabilidadebauru.com.br.">
<meta name="keywords" content="Contabilidade em Bauru, Contador Bauru, Serviços Contábeis Bauru, Escritório de Contabilidade em Bauru">
<meta name="author" content="Contabilidade Bauru">
<title>Contabilidade Bauru - Sua Solução Contábil</title>
</head>
<body>
<header>
<h1>👋 Bem-vindo à Contabilidade Bauru</h1>
<p>Soluções contábeis eficientes para empresas e empreendedores em Bauru, SP.</p>
</header>
<nav>
<ul>
<li><a href="#sobre">Sobre Nós</a></li>
<li><a href="#servicos">Serviços</a></li>
<li><a href="#contato">Contato</a></li>
</ul>
</nav>
<main>
<section id="sobre">
<h2>Sobre Nós</h2>
<p>Na <strong>Contabilidade Bauru</strong>, somos especialistas em contabilidade empresarial, planejamento tributário e suporte financeiro. Nosso objetivo é ajudar empresas locais a prosperar.</p>
</section>
<section id="servicos">
<h2>Nossos Serviços</h2>
<ul>
<li>Abertura e regularização de empresas</li>
<li>Gestão contábil e fiscal</li>
<li>Planejamento tributário</li>
<li>Consultoria financeira</li>
</ul>
</section>
<section id="contato">
<h2>Entre em Contato</h2>
<p>📞 Telefone: (14) 99901-2258</p>
<p>🌐 Site: <a href="https://www.contabilidadebauru.com.br" target="_blank">www.contabilidadebauru.com.br</a></p>
</section>
</main>
<footer>
<p>© 2025 Contabilidade Bauru - Todos os direitos reservados.</p>
<p>📍 Localizado em Bauru, SP | <a href="https://www.contabilidadebauru.com.br">Visite nosso site</a></p>
</footer>
</body>
</html>
/* Estilo geral */
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f9f9f9;
color: #333;
}
/* Cabeçalho */
header {
background-color: #004080;
color: #fff;
text-align: center;
padding: 20px 10px;
}
header h1 {
font-size: 2.5rem;
margin: 0;
}
header p {
font-size: 1.2rem;
}
/* Navegação */
nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
justify-content: center;
background-color: #0066cc;
}
nav ul li {
margin: 0 15px;
}
nav ul li a {
text-decoration: none;
color: #fff;
font-size: 1rem;
padding: 10px 15px;
transition: background-color 0.3s;
}
nav ul li a:hover {
background-color: #004080;
border-radius: 5px;
}
/* Seções principais */
main {
padding: 20px 10%;
}
section {
margin-bottom: 40px;
}
section h2 {
font-size: 1.8rem;
color: #004080;
margin-bottom: 10px;
}
section p, section ul {
font-size: 1rem;
}
section ul {
list-style: disc;
padding-left: 20px;
}
/* Links */
a {
color: #0066cc;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Rodapé */
footer {
background-color: #004080;
color: #fff;
text-align: center;
padding: 10px 20px;
}
footer p {
margin: 5px 0;
}
footer a {
color: #fff;
font-weight: bold;
}
/* Responsividade */
@media (max-width: 768px) {
nav ul {
flex-direction: column;
align-items: center;
}
nav ul li {
margin: 10px 0;
}
main {
padding: 20px 5%;
}
}
// Exibe uma saudação ao carregar a página
window.onload = function () {
alert("Bem-vindo à Contabilidade Bauru! Estamos prontos para ajudar você.");
};
// Botão para rolar ao topo
document.addEventListener("DOMContentLoaded", function () {
// Cria o botão de rolar para o topo
const scrollToTopButton = document.createElement("button");
scrollToTopButton.textContent = "⬆️ Topo";
scrollToTopButton.style.position = "fixed";
scrollToTopButton.style.bottom = "20px";
scrollToTopButton.style.right = "20px";
scrollToTopButton.style.padding = "10px 15px";
scrollToTopButton.style.backgroundColor = "#004080";
scrollToTopButton.style.color = "#fff";
scrollToTopButton.style.border = "none";
scrollToTopButton.style.borderRadius = "5px";
scrollToTopButton.style.cursor = "pointer";
scrollToTopButton.style.display = "none";
scrollToTopButton.style.zIndex = "1000";
// Adiciona o botão ao corpo da página
document.body.appendChild(scrollToTopButton);
// Mostra o botão ao rolar a página
window.addEventListener("scroll", function () {
if (window.scrollY > 300) {
scrollToTopButton.style.display = "block";
} else {
scrollToTopButton.style.display = "none";
}
});
// Adiciona funcionalidade ao botão
scrollToTopButton.addEventListener("click", function () {
window.scrollTo({
top: 0,
behavior: "smooth"
});
});
});
Also see: Tab Triggers