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

              
                <header class="container">
	<div class="border">
		<h1 id="title">Elegant Borders</h1>
	</div>
</header>

<div id="tidy-blog">

	<h2>Tidy Design Tutorial</h2>
	<p>Check out our previous blog posts:</p>

	<div class="posts">
		
		<a class="post" href="https://www.tidydesign.com/blog/2018/09/curtain-mobile-nav/">
			<div class="post-photo"></div>
			<span class="post-title">Curtain Mobile Nav</span>
		</a>
	
		<a class="post" href="https://www.tidydesign.com/blog/2018/09/creating-a-responsive-svg-overlay/">
			<div class="post-photo"></div>
			<span class="post-title">Creating a Responsive SVG Overlay</span>
		</a>

		<a class="post" href="https://www.tidydesign.com/blog/2018/08/creating-a-cut-out-text-effect/">
			<div class="post-photo"></div>
			<span class="post-title">Creating a Cut Out Text Effect</span>
		</a>

	</div>

</div>

              
            
!

CSS

              
                /* Tutorial Styles */
.container {
	padding: 0 2em;
}

.border {
	position: relative;
	width: 100%;
	max-width: 550px;
	height: 340px;
	background-color: #ccaeb9;
}

.border::before,
.border::after {
	content: '';
	position: absolute;
	border: solid 2px #ccaeb9;
}

.border::before {
	left: -20px;
	width: calc(100% + 40px);
	height: 100%;
}
.border::after {
	top: -20px;
	width: 100%;
	height: calc(100% + 40px);
}

/* Page Set Up */
*, ::after, ::before {
    box-sizing: border-box;
}
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: auto;
	overflow-x: hidden;
}

header {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 700px;
	padding: 4em;
	background-image: url('https://images.unsplash.com/photo-1520807616252-353d3e81dca6?ixlib=rb-0.3.5&s=b073789d572720d9e913fb13c15978da&auto=format&fit=crop&w=2100&q=80');
	background-size: cover;
	background-position: center;
}
.border {
	display: flex;
	align-items: center;
	justify-content: center;
}
#title {
	margin: 0;
	font-family: 'Dancing Script', cursive;
	color: #d2d0ce;
	font-size: 2.75rem;
	text-align: center;
}


#tidy-blog {
	padding: 0 1em;
}

h2 {
	margin-top: 1.25em;
	font-size: 1.75rem;
	text-transform: uppercase;
}

h2, p, a {
	font-family: 'Montserrat', sans-serif;
	text-align: center;
}

h2, a {
	color: #3086B9;
}

p {
	line-height: 1.6;
	margin-bottom: 1.25em;
}

a {
	text-decoration: none;
}

/* Post Boxes */
.posts {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	max-width: 1200px;
	margin: 0 auto;
}
.post {
	display: block;
	width: 100%;
	max-width: 400px;
	margin: 0 auto 1.5em;
	background-color: #3086b9;
	border-radius: 8px;
	overflow: hidden;
	transition: all .45s;
	text-align: center;
}
.post:hover {
	transform: scale(1.025);
}
.post-photo {
	padding-bottom: 53.5%;
	background-position: center;
	background-size: cover;
}
.post:nth-of-type(1) .post-photo {
	background-image: url('https://www.tidydesign.com/blog/wp-content/uploads/2018/09/curtain-mobile-nav-tidy-design.jpg');
}
.post:nth-of-type(2) .post-photo {
	background-image: url('https://www.tidydesign.com/blog/wp-content/uploads/2018/09/waves-12.jpg');
}
.post:nth-of-type(3) .post-photo {
	background-image: url('https://www.tidydesign.com/blog/wp-content/uploads/2018/08/cutout-2.jpg');
}

.post-title {
	display: block;
	padding: 1em .5em;
	color: #fff;
}

@media screen and (min-width: 768px) {
	#title {
		font-size: 2.75rem;
		text-align: center;
	}
	
	h2 {
		font-size: 3rem;
		margin-bottom: .35em;
	}
	
	.posts {
		margin: 2em auto;
	}
	.post {
		max-width: 540px;
		width: 48%;
	}
	
}

@media screen and (min-width: 1020px) {
	.post {
		width: 30%;
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console