cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

			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 ‘6’ 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–and–error, but doable. 
				| Another trick is to give the <h1> a viewport-relative font-size and style the inner elements (the ‘6’, ‘brands’ and ‘for the summer’) 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


Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................