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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <article id='article'  class='article--main'>
		<h1>Welcome to my website</h1>

		<div class='hero'>
				<p><strong>Lorem ipsum dolor sit amet</strong>, consectetur adipisicing elit, sed do eiusmod
			tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
			quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
			consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
			cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
			proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

			<figure id='illustration-1'>
				<img src="https://source.unsplash.com/random" />
				<figcaption><em>Lorem ipsum dolor sit amet</em>, consectetur adipisicing elit, sed do eiusmod</figcaption>
			</figure>
		</div>

		<div class='gallery'>
			<img src="https://source.unsplash.com/random" />
			<img src="https://source.unsplash.com/random" />
			<img src="https://source.unsplash.com/random" />
		</div>
	</article>
              
            
!

CSS

              
                /* 
			Hue rotation 
			------------
		*/

		* { --hue: 0; }
		* > * { --hue: 60; }
		* > * > * { --hue: 120; }
		* > * > * > * { --hue: 180; }
		* > * > * > * > * { --hue: 240; }
		* > * > * > * > * > * { --hue: 300; }
		* > * > * > * > * > * > *{ --hue: 0; }
		* > * > * > * > * > * > * > * { --hue: 60; }
		* > * > * > * > * > * > * > * > * { --hue: 120; }
		* > * > * > * > * > * > * > * > * > * { --hue: 180; }
		* > * > * > * > * > * > * > * > * > * > * { --hue: 240; }
		* > * > * > * > * > * > * > * > * > * > * > * { --hue: 300; }

		/* 
			Draw elements' boxes
			--------------------
		*/

		body :hover, body :hover > * {

			/* Opaque version */
			--c-solid: hsl(var(--hue), 100%, 50%);

			/* Translucent version */
			--c-bg: hsl(var(--hue), 100%, 50%, 0.1);

			outline: 1px solid var(--c-solid);

			background-image: 
				
				/* Content box fill */
				linear-gradient(var(--c-bg), var(--c-bg)),

				/* Content box white underpaint */
				linear-gradient(white, white),

				/* Padding box stripes */
				repeating-linear-gradient(
					45deg,
					var(--c-solid), var(--c-solid) 1px,
					var(--c-bg) 1px, var(--c-bg) 3px
				);

			background-origin:
				content-box,
				content-box,
				padding-box;
			background-repeat: no-repeat;
		}

		/* 
			Show elements' classes / ID
			---------------------------
		*/

		[id]:hover::before,
		[class]:hover::before {
			position: absolute;
			transform: translate(0, -100%);
			background: #000;
			color: hsl(var(--hue), 100%, 80%);
		}

		:not([id])[class]:hover::before {
			content: '.' attr(class);
		}

		:not([class])[id]:hover::before {
			content: '#' attr(id);
		}

		[id][class]:hover::before {
			content: '#' attr(id) '.' attr(class);
		}


		/*
			These are purely to style the demo page
		 */
		
		article {
			border: 1px solid black;
			padding: 2em;
			background: #f0f0f0;
			margin: 2em auto;
			max-width: 60em;
		}

		img {
			display: block;
			max-width: 100%;
			height: auto;
		}

		.gallery {
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			grid-gap: 1em;
		}

		.gallery > * {
			padding: 0.5em;
			box-sizing: border-box;
		}
              
            
!

JS

              
                
              
            
!
999px

Console