Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

              
                <h1>CSS Color Definition Types</h1>

<p>These are only the most common formats for defining color values. You many encounter others.</p>

<section>

	<h2>Hexadecimal / Hex Shorthand</h2>

	<p>The Hex format consists of six digits of alphanumeric code and are denoted by a preceding hashtag, like this: <code>#3ab13f</code>. These values can be easily copy-pasted from most design software.</p>

	<p>For certain colors with repeating digits in the hex code, you can use a three-digit shorthand, like this: <code>#333</code>.</p>

</section>

<section>

	<h2>RGB / RGBA</h2>

	<p><strong>The RGB format</strong> consists of defined values for each of the red, green, and blue colors. It is written like this: <code>rgb( 13, 124, 0 )</code>.</p>

	<p><strong>The RGBA format:</strong>When necessary, you can use a fourth value that denotes opacity to make the color semi-transparent. Opacity is scaled from 0–1, where 0 is completely transparent and 1 is fully opaque. An opacity of .5 is half-transparent. This is written like this: <code>rgba( 13, 124, 0, .5 )</code>. It can also be written with the letter a to denote the use of opacity: <code>rgba( 13, 124, 0, .5 )</code>.</p>

</section>
	
<section>

	<h2>Named Colors</h2>

	<p>For ease of use, there are 147 colors that have human-friendly names. These include common color names like: <code>white</code>, <code>black</code>, <code>red</code>, <code>blue</code>, etc., as well as some fancier ones like <code>cornflowerblue</code> or <code>darkolivegreen</code>.</p>

	<p>There are <a href="https://htmlcolorcodes.com/color-names/" title="Named Color Reference">many websites</a> that list all named CSS colors for reference.</p>

</section>

              
            
!

CSS

              
                /* ==========================================================================
   Type
   ========================================================================== */

html {
	line-height: 1.4;
}

h3 {
	margin-top: 3rem;
}

ul{
	padding-left: 1.2rem;
}

li {
	margin-bottom: .5rem;
}

a {
	color: cornflowerblue;
	text-decoration: none;
}

a:hover, a:active, a:focus {
	border-bottom: 1px solid cornflowerblue;
}

.callout {
	font-size: 1.33rem;
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

body {
	margin: 4rem auto;
	max-width: 35rem;
	scroll-behavior: smooth;
}

section {
	border-top: 1px solid #ccc;
	margin-top: 4rem;
	padding-top: 2rem;
}

/* ==========================================================================
   Code Examples
   ========================================================================== */

p > code,
li > code {
	background-color: #f5f2f0;
	color: #905;
	display: inline-block;
	margin: 0 .2rem;
	padding: .15rem .25rem;
}

pre[class*=language-]{
	margin-bottom: 3rem;
}

.bad {
	color: firebrick;
}

.code-example-bad {
	border-left: 3px solid firebrick;
}

.good {
	color: rgb(102, 153, 0);
}

.code-example-good {
	border-left: 3px solid rgb(102, 153, 0);
}

.rendered-example {
  background-color: ghostwhite;
  padding: .75rem;
}

.code-example-good + .rendered-example,
.code-example-good + .rendered-example {
	margin-top: -2rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console