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>
<head>
<title>Basic HTML Tags Example</title>
</head>
<body>
<div>
<h1>
Hello World! <em>This</em> is an <strong>example</strong> page.
</h1>
<br />
<p>
Sometimes <span>less</span> is more.
</p>
<p>
You can send me a message at <a href="mailto:octavio@dev.lawyer">my e-mail</a>
</p>
<p> Abaixo temos uma imagem como placeholder:
<br />
<img src="https://via.placeholder.com/150" />
</p>
<br />
<table>
<tr>
<td>First Item</td>
<td>Second Item</td>
</tr>
<tr>
<td>Third Item</td>
<td>Forth Item</td>
</tr>
</table>
<br />
<ul>
<li>Banana</li>
<li>Apple</li>
<li>Orange</li>
</ul>
<br />
<ol>
<li>Linux</li>
<li>MacOS</li>
<li>Windows</li>
</ol>
<br />
<input type="text" value="New" />
</div>
</body>
</html>
<!--
/==========================
💬 Comentários ao código
👉 🇧🇷 Versão em Português
==========================/
Esta página é um exemplo muito simples de HTML.
Com esses poucos elementos você conseguirá montar páginas HTML
que atendem boa parte das necessidades do dia a dia. Veja
abaixo uma listagem de cada "tag" e o que elas fazem:
<!DOCTYPE html> Indica ao navegador que estamos lidando com um documento HTML
<html> Indica que o documento HTML começa aqui
<head> Traz informações que são necessárias ao documento mas que
não representam elementos na página renderizada. Podemos
incluir aqui, por exemplo, scripts, estilos CSS, informações
sobre o título, links e meta-tags.
<title> É o título da página e que aparece na aba do navegador
<body> Aqui começa o "corpo" do documento, e é onde todos os elementos
que devem aparecer na página renderizada devem estar.
<div> Um dos elementos mais utilizados principalmente para organização
de elementos na tela, o div é como se fosse uma "divisão" da
página. Ao colocar um <div> a sua página terá aquele elemento que
representa uma divisão no documento que possui algum conteúdo que
deve ser exibido.
<h1> É um cabeçalho no documento (header), sendo h1 o maior e h6 o menor.
<em> Deixa o texto destacado (geralmente itálico e poderia ser <i> também,
mas <em> é melhor para acessibilidade já que pode ser interpretado
em softwares para leitura)
<strong>Deixa o texto negritado (poderia ser <b> também, mas strong é melhor
para acessibilidade)
<br /> Pula uma linha: vem de break
<p> Um parágrafo
<span> É também uma divisão, mas esta ocorre na própria linha. Serve para
segmentar o texto.
<a> Representa um link
<img /> Representa uma imagem
<input /> Campo de entrada de dados (formulario)
<ul> Lista não ordenada (bullet points)
<ol> Lista ordenada (numerada)
<li> Item de lista
<table> Tabela
<tr> Linha da tabela
<td> Coluna da tabela
Obviamente há muitos outros elementos que podemos usar em HTML e, principamente
com o surgimento do HTML5 outras funcionalidades adicionais foram incorporadas
ao HTML, dando mais flexibilidade para fazer coisas que antes eram possíveis
apenas com o uso de outras linguagens como o Javascript.
/==========================
💬 Comments to the code
👉 🇺🇸 English Version
==========================/
This page is a very simple HTML example.
With these few elements you'll be able to assemble HTML pages
that meet a good part of everyday needs. Below is a listing
of each "tag" used and what they do:
<!DOCTYPE html> Tells the browser we are dealing with an HTML file
<html> Indicates that the HTML document starts here
<head> Brings information that is needed by the document but that
do not represent elements on the rendered page. We can
include here, for example, scripts, CSS styles, information
about the title, links and meta-tags.
<title> It is the title of the page and that appears in the browser tab
<body> Here begins the "body" of the document, and this is where
all the elements that should appear on the rendered page should be.
<div> One of the most used elements mainly for organization of elements
on the screen, the div is like a "division" of the page. By placing
a <div> your page will have that element that represents a division
in the document that has some content that should be displayed.
<h1> It is a header in the document (header), with h1 being the largest
and h6 the smallest.
<em> Makes the text highlighted (usually italics and could be <i> too,
but <em> is better for accessibility as it can be interpreted
in reading softwares)
<strong>Make the text bold (could be <b> too, but strong is better
for accessibility)
<br /> Skip a line
<p> One paragraph
<span> It is also a division, but this one occurs on the line itself. It
segments the text.
<a> Represents a link
<img /> Represents an image
<input /> Input data field (form)
<ul> Unordered list (bullet points)
<ol> Ordered (numbered) list
<li> List Item
<table> table
<tr> Table row
<td> Table column
Obviously there are many other elements that we can use in HTML and especially
with the emergence of HTML5 in which other additional features were
incorporated, giving you more flexibility to do things that were previously
possible just using other languages such as Javascript.
-->
Also see: Tab Triggers