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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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>
<!-- 
	This 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 at the start of this document is a special element that we must use at the beggining of any HTML document to ensure that all of our document renders appropriately. If anything comes before the element, 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 that is NOT visible to users. 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 user-visible 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 <meta> element below is important to help change the size of our browser window to reflect the size of the device. It works as follows:

				name="viewport" - this clarifies that we are declaring something about the viewport (aka browser window)
				'width=device-width' - this specifies that the width of the viewport should be equal to the width of our device (important for mobile devices)
				'initial-scale=1' - this ensures that our website renders not zoomed-in or zoomed-out, as we have designed it to be responsive.

			If you would like more information on why we set this, I recommend reading this article - https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag
		-->
		<meta name="viewport" content="width=device-width, initial-scale=1">


		<!--
			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 be visible to the user in the web browser.	
	-->
	<body>


		<!--
			The <header> element - NOT TO BE CONFUSED WITH THE <head> ELEMENT - helps group the main headings and navigation for the content of the website. 
		-->
		<header>


			<!--
				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 <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. # + kittens = #kittens).
				-->
				<a href="#introduction">An introduction</a>
				<a href="#kittens">To the kittens</a>
			</nav>


		</header>

		

		<!--
			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 'introduction'. 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 'introduction'.
		-->
		<section id="introduction">
				
			<!--
				The <h2> element, a second-level heading is being used to help browsers understand the hierarchy of our document. 
			-->
			<h2>An introduction</h2>

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

				The <strong> element, which indicates a portion of the text as more important than the rest of the paragraph (in this case).
			-->
			<p>
				<strong>Very exciting things are happening</strong>. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
			</p>

		</section>



		<!--
			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 'kittens'. 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 'kittens'.
		-->
		<section id="kittens">

			<h2>Kittens are da cutest!</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. 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/

					'width' and 'height' - Define the width and height of the original image in pixels. Do not use other units or measurements different from the original size of the image.
				-->
				<img src="https://andrewh.ca/teaches/information_design/tutorials/01/explanation/img/kitten.jpg" alt="A blue eyed kitten standing over a bowl with a milk beard" width="1200" height="627">

				<!--
					The <figcaption> element must be used inside of a <figure> element. It defines the caption for the figure.
				-->
				<figcaption>
					It's a bundle of cute, cuddly, danger! 
					<!-- 
						Here we are creating a link to placekitten.com, note that to link outside of the existing site we have to start the link with either 'http://' or 'https://'

						Links without 'http://' or 'https://' at the beginning will point to files within our website. For example:

						<a href="contact.html">Contact</a> will link to the 'contact.html' file.
					-->
					<a href="http://placekitten.com">Photo from placekitten</a>
				</figcaption>

			</figure>

			<!--
				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.

					<em> - The emphasis element, which indicates inflection (emphasis in your speaking).
				-->
				<li>The <em>first</em> reason why kittens are dangerous.</li>
				<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
				<li>Aliquam tincidunt mauris eu risus.</li>
			</ol>

		</section>


	</body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console