css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

			span.jumbo 6 
				span.sign__text brands 
			span.subjumbo for the summer
				span.section__innertitle The inner workings
				| The first step was to find a font which had a number &lsquo;6&rsquo; that was almost perfectly circular. The font of choice in this case is Lato. 
				| The next step is to make the image fit inside the number. The trick is to pick an image and add it as a background-image of the number. The sizing is relatively easy by setting the background-size in em value. The positioning is trial&ndash;and&ndash;error, but doable. 
				| Another trick is to give the &lt;h1&gt; a viewport-relative font-size and style the inner elements (the &lsquo;6&rsquo;, &lsquo;brands&rsquo; and &lsquo;for the summer&rsquo;) with relative units, like ems, so they will always scale with the size of the title. 
				| (The font-sizes aren't bullet proof on large screens, but you get the idea)
				| Another 
				a href='https://codepen.io/search/pens?q=magazine+layout&limit=all&type=type-pens' magazine layout
				|  brought to you by 
				a href='https://codepen.io/bartveneman' a dude who likes to bring magazine layouts to the web
				| . Image taken from 
				a href="https://unsplash.com/photos/RunDjvjvtoI" Unsplash
              // SETTINGS

$primary: #333
$secondary: #fff
$cta: tomato

	@media (min-width: 48em)


@import 'https://fonts.googleapis.com/css?family=Lato:300,400,700'

	font: 400 1em/1.4 'Lato', sans-serif
	color: $primary
	-webkit-font-smoothing: antialiased

	margin: 0 0 16rem
	text-transform: uppercase
	text-align: center
	// Set a viewport-relative font-size once for the whole
	// <h1>. Child elements will be sized using em's, so they
	// will scale with this element regardlessof it's font-size
	font-size: calc(55vh + 55vw)

	display: block
	margin: -0.25em 0 0 // move up a little
	line-height: 0.875
	font-weight: 300
	background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/5175/photo-1452117774045-dfd7a5e9718c.jpeg')
	background-repeat: no-repeat
	// Trial-and error positioning and sizing
	background-size: 0.39em auto
	background-position: 53% 87.5%

	display: block
	font-size: 0.125em
	margin: -3.2em 0 0 // tweak position to it's inside the '6'

	background-color: $primary
	color: $secondary
	display: inline-block
	padding: 0 0.3em 0.1em
	line-height: 1
	position: relative
	margin: 0 0 0.45em
	// Generate the bottom border which is slightly wider
	// than the text
		content: ''
		position: absolute
		bottom: 0.08em
		border-top: 0.04em solid
		left: 0.2em
		right: 0.2em

// Had a hard time coming up with proper classnames here...
	display: block
	text-decoration: underline
	font-size: 0.03em
	text-shadow: 0.07em 0.05em 0 $secondary

		line-height: 1.5
			column-count: 2
			column-gap: 1em
			line-height: 1.33 // shorter lines of text, so lower line-height
// Not too happy with this technique: place an inline-block
// element inside a block element to get the bottom-border
// to be the right width (like an underline)
	text-align: center
	font-size: 1.15em

	text-transform: uppercase
	font-weight: 400
	border-bottom: 0.15em solid

	color: $cta


	background: $secondary

	margin: 0
		padding: 1em

	padding: 1em
	margin: 1em
	border: 1px solid
	max-width: 44em
		padding: 3em 5em
		margin-right: auto
		margin-left: auto
	margin-top: 3em
	text-align: center

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................