Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!doctype html>
<!-- Anything between the triangle brackets with the exclamation mark and dash start/end is an HTML comment. These do not render on the document for the user to view, but can be viewed in the source of the code. -->

<!--
	The 'doctype' declaration above is a special tag that we must use at the beginning of any HTML document to ensure that all of our document renders appropriately. If anything comes before the tag, the document may not be recognized as HTML5 (which may break some of our document).
-->

<!--
	The <html> element below wraps our entire document, both information about the document and the content itself. It is also showing the standard structure of an HTML tag, where:

	< ... > - Triangle brackets open/close the tag
	<html ... > - The name of the element comes first
	<html lang...> - Attributes (in this case 'lang') are declared after a separating space
	<html lang="..."> - Quotation marks wrap the attribute's value
	<html lang="en"> - The complete opening tag of the element
	<html lang="en"></html> - Both the opening and closing tags of the element

	In this case we are opening our HTML document and declaring the default language as English (en).
-->
<html lang="en">




	<!--
		The <head> element is where we declare information about our document. This includes things like the character set and title for our document. Later we will include information about how the document should resize for mobile devices as well as our stylesheets. No content should appear in here.
	-->
	<head>


		<!--
			The <meta> element defines information about our document. Because it does not have any content (it only declares attributes) there is no need to use a closing tag with it. In this case, we are declaring a character set (what kind of characters we are using) for the document. If you would like more information about character sets, I recommend reading this article - http://www.joelonsoftware.com/articles/Unicode.html
		-->
		<meta charset="utf-8">


		<!--
			The <title> element defines the title of our document. This is what ends up appearing in our tab at the top of our browser window and what is read by search engines for listing the document.
		-->
		<title>My Most Hideous Page Ever</title>


	<!--
		Remember that unless it is a self-closing element, we need to make sure to close tags.
	-->
	</head>




	<!--
		The <body> element is where we include all our content that is meant to render visibly in the web browser.
	-->
	<body>


		<!--
			The <h1> element is our highest level heading. When reading a document, browsers and search engines look at the structure and hierarchy of headings as well as content to understand how the document should be interpreted or ranked in search engines.
		-->
		<h1>My Most Hideous Page Ever</h1>


		<!--
			The <p> element is for paragraphs. Inside of this paragraph, we have a couple of additional elements including:

			<em> - The emphasis element, which indicates inflection (emphasis in your speaking)
			<abbr> - The abbreviation element, which lets us define the abbreviation's long form
		-->
		<p>
			A robot is a <em>dangerous</em>, often humanoid, autonomous being that will take over soon. We must be vigilant. We must be wary. We must prepare to stop the robots from taking over. Transformers are here and are real. Robots such as Honda's <abbr title="Advanced Step in Innovative Mobility">ASIMO</abbr> is proof of that. They walk, and soon enough they will also be able to talk and drive us around. That is dangerous.
		</p>


		<!--
			The <nav> element is for major groupings of navigation items. This can be for links within the same document, or to other documents. Think of it as a means of grouping the major links related or connected to this document.
		-->
		<nav>

			<!--
				The <a> (anchor) element allows us to link to other points in the document, or to different documents entirely. In this case, both of our links point to different ID's within our document. ID's are referenced by using the hashtag and then the name of the ID (i.e. # + robots = #robots).
			-->
			<a href="#robot">See a Robot</a>
			<a href="#comments">Comment on Robots</a>

		</nav>


		<!--
			The <section> element defines just that, a section of our document. It is more semantically meaningful then the more generic <div> (division) element, as the section element expects a heading and content.

			Within the opening section tag below, we have also defined an ID of 'robot'. This allows us to link from the navigation to this point in the document. Note that because we declare the 'id' attribute, we do not need to use a hashtag (#) before the value 'robot'.
		-->
		<section id="robot">

			<!--
				The <h2> element, a second-level heading is being used to help browsers understand the hierarchy of our document.
			-->
			<h2>See a Robot</h2>

			<!--
				The <figure> element allows us to build a relationship between multimedia elements (i.e. images, videos...) and a caption.
			-->
			<figure>

				<!--
					The <img> element is for placing images in the document. Because the image is placed within the attributes of the image element itself, we do not need to close this tag. The attributes of this tag are important:

					'src' - Sets the location of the image, which is relative to where our HTML document is saved.
					'alt' - Is alternative text that describes the image as if we did not see it. The best way to think of this is it should describe the image within its own context. For example, if the content of the image is important to understanding the document, then the alt text should describe the image. Whereas if the image is a link, the text should describe where the link is taking them. More information on making good alt text is available at http://a11yproject.com/posts/alt-text/
					'height' - Specify the height of the original image in pixels.
					'width' - Specify the width of the original image in pixels.
				-->
				<img src="https://andrewh.ca/teaches/web_design_and_development/tutorials/01/explanation/img/robot.jpg" alt="A toy robot with a menacing expression" height="1600" width="1063">

				<!--
					The <figcaption> element must be used inside of a <figure> element. It defines the caption for the figure media.
				-->
				<figcaption>Beware of robots like this.</figcaption>

			</figure>

			<h3>Links about robots:</h3>
			<!--
				The <ol> element defines an ordered list. Note that only <li> (list items) can appear inside of an <ol> element.
			-->
			<ol>
				<!--
					The <li> element is a list item. Depending on if the list item is within an ordered list <ol> element or unordered list <ul> element either numbers or bullets will be placed before each list item.
				-->
				<li>
					<!--
						In this anchor element, we are linking outside of our document. As a result, we need to make sure to start the 'href' attribute with either http:// or https:// - otherwise it will try to link to a document on our server. The 'target' attribute allows us to define a link to open in a new window.
					-->
					<a href="https://en.wikipedia.org/wiki/Robot" target="_blank">Wikipedia on Robots</a>
				</li>
				<li>
					<a href="https://www.shutterstock.com/search/robots?search_source=base_keyword" target="_blank">Photos of robots</a>
				</li>
			</ol>


			<h3>The code of how robots deal with humans:</h3>

			<!--
				The <code> element defines a piece code. Inside of the <code> element we have included <br> (break) elements which define a semantic line-break - somewhere that a line-break is expected in the conventions of the language.
			-->
			<code>
				# Human protocol<br>
				robot.see("human", function(seen) {<br>
				seen.destroy();<br>
				});<br>
			</code>

			<h3>What the robot does as a result:</h3>

			<!--
				The <samp> element represents the sample output from a program.
			-->
			<samp>EXTERMINATE! EXTERMINATE! EXTERMINATE!</samp>

		</section>


		<section id="comments">

			<h2>Comment on Robots</h2>
			<p>Leave your comments on the evils of robots:</p>

			<!--
				The <form> element defines a collection of form elements (labels, inputs, buttons). All valid forms must use a 'method' (for submitting the form), and an 'action' which defines what will submit the form. To have form submission work properly, you require some server-side scripting which we don't quite cover in this course.  -->
			<form method="post" action="#">

				<!--
					The <label> element clarifies what form elements are semantically for. Labels are associated with form elements using 'id' attributes, NOT with 'name' attributes
				-->
				<label for="form-name">Name:</label>
				<!--
					The <input> element allows for a variety of input types within forms. In this case the type is defined as text input, and is left with a 'placeholder' attribute to help the user understand expected input. Because there is no content for an input, it is a self-closing element.
				-->
				<input type="text" id="form-name" placeholder="Jane Doe">

				<label for="form-subject">Subject:</label>
				<input type="text" id="form-subject" placeholder="A title for your comment">

				<label for="form-comment">Comment:</label>
				<!--
					Whereas the <input> element allows for one line of text input, the <textarea> element allows for multi-line text input instead of a single line. Because there is a potential of it having content, it is NOT a self-closing element.
				-->
				<textarea id="form-comment" placeholder="Please place comment here"></textarea>

				<!--
					Here we are using the <input> element to act as a submit button for our form. The 'value' attribute in this case defines the button's label.
				-->
				<input type="submit" value="Submit your comment">

			</form>

		</section>


	</body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console