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

Auto Save

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-Only Infobox</h1>
<main>
	<h2>Trigger the Infobox by klicking the Button below</h2>
	<span class="md-caption">The Button triggers a checkbox, and then the Infobox gets unhidden c:</span>
	<p>
		<label for="menuToggle" class="toggleButton md-button md-button--raised">Toggle Infobox</label>
	</p>
	
	<div>
		<input id="menuToggle" type="checkbox">
		<div class="infobox md-card">
			<div class="md-card-content">
				<h2>The Magic Infobox</h2>
				<span class="md-caption">This Box gets visually (un)hidden via the Toggle button.</span>
				<p>Agenda democratizing the global financial system, human being safeguards pathway to a better life accessibility economic independence underprivileged.</p>
				<p>Contribution; sustainability mobilize meaningful enabler equity Bill and Melinda Gates support metrics committed public service. Shifting landscape improving quality countries cross-cultural lasting change free expression peaceful.</p>
			</div>
			<div class="md-card-btns">
				<label for="menuToggle" class="md-button">Close Box</label>
			</div>
		</div>
	</div>
</main>
              
            
!

CSS

              
                /* ENVIROMENT */
	@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,300);
	*{
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
	body{
		background-color: rgb(238,238,238);
		font-family: 'Roboto', sans-serif;
	}
	main{
		padding: 40px 60px;
	}
	h1{
		font-weight: 300;
		width: 100%;
		background-color: rgb(64,81,181);
		color: rgb(255,255,255);
		padding: 20px 60px;
	}
	h2{
		font-weight: 400;
	}
	p + p{
		margin-top: .7em;
	}
	.md-caption{
		font-size: .7em;
		line-height: 22px;
		line-height: 1.4rem;
		opacity: .7;
		filter: alpha(opacity=70);
	}
	.md-button{
		display: inline-block;
		font-weight: 500;
		font-size: 1em;
		padding: 8px;
		min-width: 88px;
		border-radius: 2px;
		border: none;
		text-align: center;
		text-transform: uppercase;
		cursor: pointer;
		-webkit-transition: all .3s;
		        transition: all .3s;
	}
	.md-button:hover{
		background-color: rgba(0,0,0, .1);
	}
	.md-button.md-button--raised{
		background-color: rgb(64,81,181);
		color: rgb(255,255,255);
		box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
	}
	.md-button.md-button--raised:hover{
		background-color: rgb(64,81,181);
		box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
	}
	.md-card{
		background-color: rgb(255,255,255);
		border-radius: 5px;
		overflow: hidden;
	}
	.md-card-content{
		padding: 20px;
	}
	.md-card-btns{
		width: 100%;
		border-top: 1px solid rgb(200,200,200);
		text-align: right;
		padding: 8px 12px;
	}
	.toggleButton{
		margin-top: 20px;
	}

/* TOGGLE */
	#menuToggle{
		display: none;
	}
	
	.infobox{
		visibility: hidden;
		opacity: 0;
		filter: alpha(opacity=0);
		position: fixed;
		top: 50%;
		left: 50%;
		-webkit-transform: translate(-50%, -50%);
		    -ms-transform: translate(-50%, -50%);
		        transform: translate(-50%, -50%);
		min-width: 400px;
		z-index: 1;
		box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
		-webkit-transition: visibility 0s .4s, opacity .4s 0s;
		        transition: visibility 0s .4s, opacity .4s 0s;
	}
	:checked + .infobox{
		visibility: visible;
		opacity: 1;
		filter: alpha(opacity=100);
		-webkit-transition: visibility 0s 0s, opacity .4s .1s;
		        transition: visibility 0s 0s, opacity .4s .1s;
	}
              
            
!

JS

              
                
              
            
!
999px

Console