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. You can use the CSS from another Pen by using it's URL and the proper URL extention.
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 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.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Technical Documentation</title>
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet" type="text/css">
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</head>
<nav id="navbar">
<header>HTML Documentation</header>
<ul>
<li><a href="#Html_Introduction" class="nav-link">Html Introduction</a></li>
<li><a href="#Code_Editors" class="nav-link">Code Editors</a></li>
<li><a href="#The_Inline_code_element" class="nav-link">The Inline code element</a></li>
<li><a href="#Html_Basic" class="nav-link">Html Basic</a></li>
<li><a href="#Html_Headings" class="nav-link">Html Headings</a></li>
</ul>
</nav>
<main id="main-doc">
<section class="main-section" id="Html_Introduction">
<header>Html Introduction</header>
<p>HTML (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (CSS) or functionality/behavior (JavaScript).</p>
<p>"Hypertext" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.
</p>
<ul>
<li>HTML stands for hypertext markup language</li>
<li>HTML is the standard markup language for creating web pages</li>
<li>HTML describes the structure of a web page</li>
<li>HTML consists of a series of elements</li>
<li>HTML elements tell the browser how to display the content</li>
</ul>
</section>
<section class="main-section" id="Code_Editors">
<header>Code Editors</header>
<p>Web pages can be created and modified by using professional HTML editors.
However, for learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac).</p>
<p>We believe in that using a simple text editor is a good way to learn HTML.</p>
</section>
<section class="main-section" id="The_Inline_code_element">
<header>The Inline code element</header>
<p>The HTML <span>code</span> element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code.</p>
<p>The <code>push()</code> method adds one or more elements to the end of an array and returns the new length of the array.</p>
<p>The function <code>selectAll()</code> highlights all the text in the
input field so the user can, for example, copy or delete the text.</p>
<p>a further inline <code>
x = 5; y = 6; z = x + y; </code> element example.</p>
<p>The HTML <code>button</code> tag defines a clickable button.</p>
<p>The CSS <code>background-color</code> property defines the background color of an element.</p>
</section>
<section class="main-section" id="Html_Basic">
<header>Html Basic</header>
<h3>html documents</h3>
<p>All HTML documents must start with a document type declaration:<span>!Doctype Html</span></p>
<p>The HTML document itself begins with <span> html </span> and ends with <span>/html</span>.</p>
</section>
<section class="main-section" id="Html_Headings">
<header>Html Headings</header>
<p>HTML headings are defined with the <span>h1</span> to <span>h6</span> tags.</p>
<p><span>h1</span>defines the most important heading. <span>h6</span> defines the least important heading: </p>
</section>
</main>
body{
background:#fff7e6;
}
#navbar {
float:left;
width:200px;
margin:0;
padding:10px;
}
#navbar header{
text-align:center;
border-bottom: 1px solid;
width:235px;
margin-left:-44px;
}
#navbar ul{
height:100%;
}
#navbar li{
list-style-type:none;
border-bottom:1px solid;
padding-bottom:20px;
width:210px;
margin-left:-60px;
}
#navbar a {
display: block;
text-decoration:none;
text-align:center;
color: rgba(0, 22, 22, 0.4);
width:160px;
padding:10px;
}
header{
font-size: 1.8em;
font-weight:thin;
}
#main-doc{
margin-left:200px;
padding:10px;
border-left:solid;
}
span{
font-style:italic;
}
code {
display: block;
text-align: left;
white-space: pre-line;
position: relative;
word-break: normal;
word-wrap: normal;
line-height: 2;
background-color: #f7f7f7;
padding: 15px;
margin: 10px;
border-radius: 5px;
}
/* smartphones, iPhone, portrait 480x320 phones */
@media only screen and (min-width:320px) and (max-width:480px){
#navbar{
width:40%;
}
#navbar header{
font-size:1em;
font-weight:100;
width:156px;
}
#navbar li{
width:130px;
}
#navbar a{
width:120px;
padding:2px;
}
#main-doc{
margin-left:120px;
}
}
/* big landscape tablets, laptops, and desktops */
@media only screen and (min-width:961px) and (max-width:1025px){
#navbar a{
font-size:1.4em;
padding:20px;
}
#main-doc{
font-size:1.4em;
}
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers