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.
<h1>
Introduction To Coding Terminology
</h1>
<p>Coding makes use of special characters on the computer keyboard to tell the computer what to do.</p>
<p>Coding tends to make use of punctuation or special characters that are on an English US keyboard but are punctuation/characters that aren't used much in English writing.</p>
<p>Here are some of the most used special punctuation/characters terminology and their meanings when used in coding.</p>
<h2>Brackets</h2>
<p>Coding uses at least four different types of brackets. Brackets are used to wrap sections of code.
<ol>
<li>( ) Round brackets. Round brackets are the most common sort of brackets used in English writing (often for an afterthought, or explanation.)</li>
<li>[ ] Square brackets.</li>
<li>
< > Angle brackets. Used in HTML tags.</li>
<li>{ } Curly brackets. Used in CSS definitions.
</ol>
<p>On non-US keyboards you may need to type a special combination of buttons to get curly brackets for example:</p>
<ul>
<li>Alt ⌥ + (</li>
<li>Alt ⌥ + 5</li>
</ul>
<h2>Special characters</h2>
<h3><span class="dot">. Dot</span></h3>
<p>. is known in coding as a <strong>dot</strong> and is used in web addresses e.g. .com is pronounced dot com.</p>
<h3><span class="forward-slash">/ Forward slash</span></h3>
<p>/ is known as <strong>forward slash</strong>. It is used in web addresses to indicate a web page or section is <em>inside</em> another section of the website.
<p>This is different to in english writing, where a forward slash is used to indicate an alternative and/or combination.</p>
<p>On a computer, <strong>forward slash</strong> is used in a file address to indicate that a file or folder is <em>inside</em> another folder</p>
<p>It is called a <strong>slash</strong> probably because it looks like a large sword or knife cut, which in English we sometimes call a slash*.</p>
<h3><span class="backslash">\ Backslash</span></h3>
<p>\ is known as <strong>backslash</strong> and is used on Windows PCs in a file address to indicate that a file or folder is <em>inside</em> another folder</p>
</p>
<p><small>* Note: Horror films like Halloween 6: The Curse of Michael Myers are sometimes known as "slasher films".</small></p>
<img src="https://upload.wikimedia.org/wikipedia/en/d/d6/Halloween6cover.JPG" alt="Halloween 6: The Curse of Michael Myers, film poster">
<p><a href="https://en.wikipedia.org/wiki/Halloween:_The_Curse_of_Michael_Myers">Halloween 6: The Curse of Michael Myers</a>
<h2>Intermediate Special Characters</h2>
<h3><span class="ampersand">& Ampersand</span></h3>
<p>& is known as the <strong>ampersand</strong>. Some special characters you can't used in text because they are used to represent computer code, so instead you use an <a href="https://www.w3schools.com/html/html_entities.asp">HTML entities</a>.
For example &amp; is the HTML entity code for ampersand.
<h3><span class="colon">: Colon</span> and <span class="semicolon">; Semicolon</span></h3>
<p>: is known as the <strong>colon</strong>. It is used in English most commonly before an explanation. In CSS coding a colon comes before giving a HTML tag a property, for example a color.</p>
<p>; is known as the <strong>semicolon</strong>. It is used in web coding to end a bit of code.</p>
<h3>- Hyphen</h3>
<p>- is known as a <strong>hyphen</strong>. It is used in coding often instead of a space, for example in the CSS property font-family. In maths it is called the minus sign - as in plus + and minus -.</p>
<h2>Colors</h2>
<p>We use the word color (not colour) because we use the US spelling for color, which is used more worldwide.</p>
<p>In HTML (a good coding language for beginners because its for the web, it's forgiving, and it's visual) we can use one of <a href="https://www.w3schools.com/colors/colors_names.asp">140 named HTML colors</a>, such as <span class="DarkRed">DarkRed</span> (the color spectrum has been divided ÷):</p>
<div>
Colors:
</div>
<div class="DarkRed">DarkRed</div>
<h2>Intermediate Colors</h2>
<p>It is a good idea to use a color-blind friendly palette***. For example:</p>
<div class="CornflowerBlue">
CornflowerBlue
</div>
<div class="MediumSlateBlue">
MediumSlateBlue
</div>
<div class="MediumVioletRed">
MediumVioletRed
</div>
<div class="Chocolate">
Chocolate
</div>
<div class="Orange">
Orange
</div>
<p>The color spectrum is actually divided into 16,777,216 colors. Each can be represent by a hexadecimal hex code that is prefixed by a # symbol, which is known as a <strong>hash</strong> or <strong>pound</strong> sign.</p>
<ul>
<li>
<ol class="alpha">
<li>Name: CornflowerBlue</li>
<li>Hexadecimal code: #6495ed</li>
</ol>
</li>
<li>
<ol class="alpha">
<li>Name: MediumSlateBlue</li>
<li>Hexadecimal code: #7b68ee</li>
</ol>
</li>
<li>
<ol class="alpha">
<li>Name: MediumVioletRed</li>
<li>Hexadecimal code: #C71585</li>
</ol>
</li>
<li>
<ol class="alpha">
<li>Name: Chocolate</li>
<li>Hexadecimal code: #d2691e</li>
</ol>
</li>
<li>
<ol class="alpha">
<li>Name: Orange</li>
<li>Hexadecimal code: #ffa500</li>
</ol>
</li>
</ul>
<p><small>Footnote: ** HTML named colors blind friendly palette, inspired by <a href="https://davidmathlogic.com/colorblind/"> Coloring for Colorblindness by David Nichols</a> and the <a href="https://www.ibm.com/design/v1/language/resources/color-library/">IBM Color Blind Safe Color Library</a></small></p>
<footer><small>Made by <a href="https://www.louiechristie.com">Louie Christie</small>.</footer>
h1,
h2,
h3,
p,
li {
font-family: Helvetica, Arial, sans-serif;
}
{
font-family: Helvetica, Arial, sans-serif;
}
h1 {
color: CornflowerBlue;
}
h2 {
color: MediumSlateBlue;
}
h3 {
color: MediumVioletRed;
}
ul {
list-style-type: square;
}
.dot {
color: MediumVioletRed;
}
.forward-slash {
color: Chocolate;
}
.backslash {
color: Orange;
}
.colon {
color: MediumVioletRed;
}
.semicolon {
color: Chocolate;
}
img {
border-width: 10px;
border-style: dashed;
border-color: DarkRed;
}
.quotation-mark {
color: MediumVioletRed;
}
.ldquotation-marks {
color: Chocolate;
}
.rdquotation-marks {
color: Orange;
}
div {
border: 1px solid LightGrey;
padding: 10px;
margin: 20px;
}
.CornflowerBlue {
color: white;
background-color: CornflowerBlue;
}
.MediumSlateBlue {
color: white;
background-color: MediumSlateBlue;
}
.MediumVioletRed {
color: white;
background-color: MediumVioletRed;
}
.Chocolate {
color: white;
background-color: Chocolate;
}
.Orange {
color: white;
background-color: Orange;
}
.DarkRed {
color: DarkRed;
}
.alpha {
list-style-type: lower-alpha;
margin: 10px;
}
footer {
text-align: center;
}
Also see: Tab Triggers