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.
<body>
<nav id="sidebar">
<h2>HTML</h2>
<ul>
<li><a class="nav-item" href="#Introduction">Introduction</a></li>
<li>
<a class="nav-item" href="#html_editors">HTML Editors</a>
</li>
<li>
<a class="nav-item" href="#html_elements">HTML Elements</a>
</li>
<li><a class="nav-item" href="#html_attributes">HTML Attributes</a></li>
<li><a class="nav-item" href="#html_heading">HTML Heading</a></li>
<li>
<a class="nav-item" href="#html_paragraph">HTML Paragraph</a>
</li>
<li><a class="nav-item" href="#html_style">HTML Style</a></li>
<li><a class="nav-item" href="#html_formatting">HTML Formatting</a></li>
<li><a class="nav-item" href="#reference">Reference</a></li>
</ul>
</nav>
<main id="documentation">
<section id="Introduction">
<h2>Introduction</h2>
<article>
<p>
HTML is an acronym for HyperText Markup Language, and it is the
standard language for creating web-pages. Every web page you surf on
your browser is built using HTML. The primary use of HTML to provide
a proper structure to the web-page so all the content or data of the
page could represent adequately. A stand-alone HTML can create only
static and skeleton looking black and white pages, but with the help
of CSS and JavaScript , we can create a more interactive and
intuitive web-page. When we try to visit a website or click on the
link, we basically request the server to show us the page, then the
server acts on our request and sends us an appropriate HTML document
as a response. Then this HTML document parsed by browse, and we able
to see the content.
</p>
<h3>HTML Document</h3>
<pre>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html></pre>
</article>
</section>
<section id="html_editors">
<h2>HTML Editors</h2>
<article>
<p>
However, you can use notepad to create and edit HTML documents, but
we recommend to install an open-source editor. There are many free
to use text-editor software present on the internet, which provides
a better interactive User interface and some add-on functionality
which you miss on a notepad.
</p>
<p>Here is the list of top 4 HTML text editors you can pick:</p>
<ul>
<li>Sublime Text Editor</li>
<li>Notepad++</li>
<li>Visual Studio Code</li>
<li>Atom</li>
</ul>
</article>
</section>
<section id="html_elements">
<h2>HTML Elements</h2>
<article>
<p>
The HTML elements provide the semantic meaning to the web-page
content. We usually interchangeably use the term HTML elements and
tags, but technically both are different. An HTML tag is just a
character inside the angle bracket<>, whereas the HTML element is a
collection of starting tag, its attribute, content and end tag. For
example:
</p>
<pre><p class= "para"> Hello World </p></pre>
</article>
</section>
<section id="html_attributes">
<h2>HTML Attributes</h2>
<article>
<p>
In HTML, the attributes are used to provide additional information
about the elements. For most of the HTML elements, attributes are
optional, but there are some elements where we have to deliver the
attributes. Attributes always specified within the opening tag of
the HTML element and they specified in a name and value pair.
<strong> Example </strong>
</p>
<pre><image src= "cat.jpg" alt ="cat image"></pre>
<p>
In this example src ="cat.jpg" and alt="cat image" are two
attributes where src and alt are attributes name and "cat.jpg" and
"cat image" are attributes values. Here alt attribute is optional,
but src is mandatory because src specify which image to show. There
should be at least one space gap between two attributes, and the
value of the attributes must have resided in the double inverted
comma. Some most important HTML
</p>
</article>
</section>
<section id="html_heading">
<h2>HTML Heading</h2>
<p>
To display the section heading, title or subtitle we can use the HTML
heading tags. In HTML 5 we have 6 heading tags start from <h1>
up to <h6>, where <h1> specify the largest heading and
<h6> represent the smallest or sub heading. If the content is
specified by heading tags, then it would be displayed large and bold
as compared to other text content present on the web-page.
<strong> Example </strong>
</p>
<pre>
<h1>First Heading </h1>
<h2>Second Heading </h2>
<h3>Third Heading </h3>
<h4>Forth Heading </h4>
<h5>Fifth Heading </h5>
<h6>Sixth Heading </h6></pre>
</section>
<section id="html_paragraph">
<h2>HTML Paragraph</h2>
<article>
<p>
In HTML paragraphs can be defined using <p> element. Paragraph
text always starts from a new line, the browser parsed the <p>
tag and automatically add some margin and white space after the end
</p> tag.
</p>
<pre>
<p> Hello! and Welcome to TechGeekBuzz </p>
<p> Here you get to know all about the latest technology. </p></pre>
</article>
</section>
<section id="html_style">
<h2>HTML Style</h2>
<article>
<p>
Every browser has a specific engine that parses the HTML document and displays a default style of the page content.
</p>
<pre><body style="background-color:yellow;">
<h1>TechGeekBuzz</h1>
<p>Welcome to TechGeekBuzz.</p>
</body></pre>
</article>
</section>
<section id="html_formatting">
<h2>HTML Formatting</h2>
<article>
<p>
In HTML, we have many special elements that can provide special meaning to text content.
</p>
<div class="hscroll">
<table>
<tbody>
<tr>
<td>
<a href="https://www.techgeekbuzz.com/html-elements/">
HTML Elements
</a>
</td>
<td>
Description
</td>
</tr>
<tr>
<td>
<b>
</td>
<td>
Bold the text
</td>
</tr>
<tr>
<td>
<strong>
</td>
<td>
An alternative for <b>, which tell that this text is essential.
</td>
</tr>
<tr>
<td>
<i>
</td>
<td>
Italic the text
</td>
</tr>
<tr>
<td>
<em>
</td>
<td>
Similar to italic but used when we want to emphasize the text.
</td>
</tr>
<tr>
<td>
<mark>
</td>
<td>
It marks the text with a default "yellow" background colour
</td>
</tr>
<tr>
<td>
<small>
</td>
<td>
Decrease the text size
</td>
</tr>
<tr>
<td>
<del>
</td>
<td>
It prints a cross line over the text.
</td>
</tr>
<tr>
<td>
<ins>
</td>
<td>
Represents the inserted text by putting an underline.
</td>
</tr>
<tr>
<td>
<sub>
</td>
<td>
This element is used to display the subscript.
</td>
</tr>
<tr>
<td>
<sup>
</td>
<td>
It can make a text superscript.
</td>
</tr>
</tbody>
</table>
</div>
</article>
</section>
<section id="reference">
<h2>Reference</h2>
<article>
<ul>
<li>
All the documentation in this page is taken from
<a href="https://www.techgeekbuzz.com/tutorial/html/" target="_blank">HTML Tutorial</a>
</li>
</ul>
</article>
</section>
</main>
</body>
html,
body {
min-width: 290px;
color: #4d4e53;
background-color: #ffffff;
font-family: "Open Sans", Arial, sans-serif;
line-height: 1.5;
}
#sidebar {
position: fixed;
min-width: 290px;
top: 0px;
left: 0px;
width: 300px;
height: 100%;
border-right: solid;
border-color: rgba(0, 22, 22, 0.4);
}
h2 {
color: black;
margin: 10px;
text-align: center;
font-size: 1.8em;
font-weight: thin;
}
#documentation h2 {
text-align: left;
margin: 0px;
}
#sidebar ul {
height: 88%;
padding: 0;
overflow-y: auto;
overflow-x: hidden;
}
#sidebar li {
color: #4d4e53;
border-top: 1px solid;
list-style: none;
position: relative;
width: 100%;
}
#sidebar .nav-item {
display: block;
padding: 10px 30px;
color: #4d4e53;
text-decoration: none;
cursor: pointer;
}
#documentation {
position: absolute;
margin-left: 310px;
padding: 20px;
margin-bottom: 110px;
}
section article {
color: #4d4e53;
margin: 15px;
font-size: 0.96em;
}
section li {
margin: 15px 0px 0px 20px;
}
pre {
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;
}
.hscroll {
overflow-x: auto;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
@media only screen and (max-width: 815px) {
/* For mobile phones: */
#sidebar ul {
border: 1px solid;
height: 207px;
}
#sidebar {
background-color: white;
position: absolute;
top: 0;
padding: 0;
margin: 0;
width: 100%;
max-height: 275px;
border: none;
z-index: 1;
border-bottom: 2px solid;
}
#documentation {
position: relative;
margin-left: 0px;
margin-top: 270px;
}
}
@media only screen and (max-width: 400px) {
#documentation {
margin-left: -10px;
}
}
Also see: Tab Triggers