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

              
                <figure class="u-glue-parent o-block">
	<figcaption class="u-glue c-tag" data-glue-corner="top right">Caption</figcaption>
	<figcaption class="u-glue c-tag2" data-glue-corner="top left">Caption</figcaption>
	<img class="o-block__image" src="https://picsum.photos/350/200" />
</figure>
              
            
!

CSS

              
                // Read more here: https://notlaura.com/u-glue/

// Note: this is algorithm relies only on features native to vanilla CSS. 
// SCSS syntax is enabled for inline comments and light nesting.

// ----
// Begin the .u-glue algorithm/API/pattern thing
// ----

.u-glue-parent {
	position: relative;
}

.u-glue {
	position: absolute;

	// We don't actually *need* rulesets for "top" nor "left" 
	// because they are the defaults! However, depending on 
	// other styles applies to these elements, top and left
	// may be necessary to reset the box's position.
	&[data-glue-corner*="top"] {
		top: 0;
	}

	&[data-glue-corner*="left"] {
		left: 0;
	}

	&[data-glue-corner*="bottom"] {
		bottom: 0;
	}

	&[data-glue-corner*="right"] {
		right: 0;
	}

	
	@supports( --color: blue ) {
		// Create a custom property to be set in the project using .u-glue.
		// Browsers who don't support this, won't get this.
		transform: var(--u-glue__transform, initial);
	}
}



// ----
// Consuming the .u-glue API/algorithm/thing.
// These are styles local to the project that includes .u-glue.
// ----

.o-block {
	max-width: 500px;
	margin-top: 2rem;
	margin-left: auto;
	margin-right: auto;
	
	// Flex is used here for making the image size relative to it's container.
	display: flex; 
}

.o-block__image {
	width: 100%;
}

.c-tag {
	--u-glue__transform: translate( 50%, 50% );
	
	background-color: coral;
	padding: 0.5rem;
	color: white;
	border: 2px solid navy;
}

.c-tag2 {
	--u-glue__transform: translate( -50%, -50% );
}

              
            
!

JS

              
                
              
            
!
999px

Console