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 id="head">
    <nav id="main-navigation" class="navigation">
        <a href="#" class="logo">
            <div class="logo-text">Lorem Ipsum</div>
        </a>
        <div class="hamburger-menu">
            <div class="hamburger"></div>
        </div>
        <div class="menu-container">
            <ul class="menu">
                <li class="menu-link"><a class="link" href="#">Home</a></li>
                <li class="menu-link"><a class="link" href="#">About</a></li>
                <li class="menu-link"><a class="link" href="#">Office</a></li>
                <li class="menu-link">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure reprehenderit, recusandae blanditiis dolores quis quisquam beatae necessitatibus facere, quae a.</p>
                </li>
                <li class="menu-link menu-line"></li>
                <li class="menu-link"><a class="link" href="#">Contact</a></li>
            </ul>
            <div class="menu-info">
                <p>Lorem Ipsum - London • Abbey Road 7 • (060/1234-567)<br/> random@random.com</p>
            </div>
        </div>
    </nav>
</header>

<section>
    <article>
        <pre>
           -- Click on hamburger at top right --



            Take bread away from me, if you wish,
            take air away, but
            do not take from me your laughter.

            Do not take away the rose,
            the lance flower that you pluck,
            the water that suddenly
            bursts forth in joy,
            the sudden wave
            of silver born in you.

            My struggle is harsh and I come back
            with eyes tired
            at times from having seen
            the unchanging earth,
            but when your laughter enters
            it rises to the sky seeking me
            and it opens for me all
            the doors of life.

            My love, in the darkest
            hour your laughter
            opens, and if suddenly
            you see my blood staining
            the stones of the street,
            laugh, because your laughter
            will be for my hands
            like a fresh sword.

            Next to the sea in the autumn,
            your laughter must raise
            its foamy cascade,
            and in the spring, love,
            I want your laughter like
            the flower I was waiting for,
            the blue flower, the rose
            of my echoing country.

            Laugh at the night,
            at the day, at the moon,
            laugh at the twisted
            streets of the island,
            laugh at this clumsy
            boy who loves you,
            but when I open
            my eyes and close them,
            when my steps go,
            when my steps return,
            deny me bread, air,
            light, spring,
            but never your laughter
            for I would die. 
            
            
            Pablo Neruda
      </pre>
    </article>
</section>
              
            
!

CSS

              
                @import 'https://fonts.googleapis.com/css?family=Calligraffitti';
@import 'https://fonts.googleapis.com/css?family=Montserrat';
$red: #ce3745;

@mixin menu-opened {

	$t: .1;
	@for $i from 1 through 6 {
		$temp: #{.85+$t}s;

		.menu-open &:nth-child(#{$i}) {
			opacity: 1;
			transition: .2s opacity $temp;
		}

		$t: $t + .1;
	}
}

@mixin menu-closed {

	@for $i from 1 through 6 {
		$temp: #{$i*.05}s;

		&:nth-child(#{$i}) {
			opacity: 0;
			transition: .2s opacity $temp;
		}

	}
}

html {
	font-size: 12px;
}

body {
    background: #333;
    font-family: 'Montserrat', sans-serif;
    padding-top: 50px;

	&.menu-open {
		overflow: hidden;
	}
}

a {
    text-decoration: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.navigation {

	.logo {
		position: fixed;
		left: 32px;
		top: 42px;
		z-index: 10;
		opacity: 1;
		transition: opacity .3s;

		.logo-text {
			display: inline-block;
			font-size: 1.2em;
			background-size: cover;
            color: #fff;
            font-family: 'Calligraffitti', serif;
		}
	}

	.hamburger-menu {
		width: 40px;
		height: 40px;
		position: fixed;
		padding: 15px 8px;
		top: 32px;
		right: 32px;
		cursor: pointer;
		z-index: 999;
		opacity: 1;

		&:hover {

			.hamburger {

				&::before {
					transform: translate(0, -1px);
				}

				&::after {
					transform: translate(0, 1px);
				}
			}
		}

		.hamburger {
			width: 24px;
		    height: 10px;
		    position: relative;

			&::before,
			&::after {
				content: '';
				width: 24px;
				height: 2px;
				background: #fff;
				position: absolute;
				left: 0;
				transition: all .3s;
			}

			&::before {
				top: 0;
			}

			&::after {
				top: 8px;
			}
		}
        
        .menu-open  & {
            
            .hamburger {
                
                &::before,
				&::after {
					background: #fff;
				}

				&::before {
					transform: rotate(45deg);
				}

				&::after {
					top: 0;
					transform: rotate(-45deg);
				}
			}
        }	
	}

	.menu-container {
		width: 0%;
		height: 100%;
		position: fixed;
		display: block;
		top: 0;
		right: 0;
		z-index: 800;
		overflow: hidden;
		transition: all .5s cubic-bezier(.99,.04,.87,1) .3s;
		background: $red;
		opacity: 0;

		.menu-open & {
			width: 100%;
			opacity: 1;
		}

		.menu {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			text-align: center;
			z-index: 1;
			list-style: none;
			margin: 0;

			@media (max-width: 667px) and (min-width: 320px) and (orientation: landscape) {
				display: initial;

				li {
					display: inline-block;
					margin: 0 16px;

					&:nth-child(4) {
						margin: 0;
					}
				}
			}

			li {
				@include menu-opened;
				@include menu-closed;
				padding: 0;
				flex: 1;

				&:nth-child(4) {

					p {
						margin: 16px 0;
					}

					@media (max-width: 667px) and (min-width: 320px) and (orientation: landscape) {

						p {
							margin: 0;
						}
					}
				}

				&.menu-line {
					width: 30px;
					height: 1px;
					background: #fff;
				    margin: 32px auto 16px;
					padding: 0;
					flex: initial;

					@media (max-width: 667px) and (min-width: 320px) and (orientation: landscape) {
						display: none;
					}
                    
                    @media (min-width: 667px) {
                        width: 1px;
                        height: 87px;
                    }
				}

				a {
					display: block;
					color: #fff;
					font-size: 1.5rem;
					transition: color .3s;
					padding: 16px 0;
                    outline: 0;

					&:hover {
						color: #333;
					}

					@media (min-width: 1190px) {
						font-size: 2rem;
					}
				}

				p {
					color: #fff;
					font-size: 1rem;
					margin-bottom: 0;

					@media (min-width: 930px) {
						font-size: 1.2rem;
					}

					@media (min-width: 1190px) {
						font-size: 1.5rem;
					}
				}
			}
		}

		.menu-info {
			text-align: center;
			position: absolute;
			width: 100%;
			bottom: 16px;
			line-height: 1.6em;
			left: 0;
			color: #fff;
			z-index: 1;
			padding: 0 16px;
			transform: translate(0, calc(100% + 16px));
			transition: .3s 1s;

			p {
				font-size: 1rem;
				margin-bottom: 0;

				@media (min-width: 930px) {
					font-size: 1.4rem;
				}

				@media (min-width: 1190px) {
					font-size: 1.7rem;
				}
			}

			.menu-open & {
				transform: translate(0, 0);
			}
		}
	}
}

section {
    margin: 0 90px 0 0;
    
    article {
        text-align: center;
        margin-top: 50px;
        color: #fff;
        font-size: 1.5em;
        letter-spacing: .12em;
        text-shadow: 1px 1px 1px rgba(0, 0, 0, .6);
    }
}
              
            
!

JS

              
                //This is just to add/remove menu-open class on body using plain javascript (practice purpose). Jquery code to replace this is: 

// $('.hamburger-menu, .link').click(function () {
// 	$('body').hasClass('menu-open') ? ($('body').removeClass('menu-open')) : ($('body').addClass('menu-open'));
// });

//However, don't forget to include jQuery for it to work.

function toggleMenu() {
    var body = document.body;
		body.className.match(/(?:^|\s)menu-open(?!\S)/) ? body.className = body.className.replace( /(?:^|\s)menu-open(?!\S)/g , '' ) : body.className += "menu-open";
}

window.onload = function() {
    var hamburger = document.getElementsByClassName('hamburger-menu')[0];
    var menuLinks = document.getElementsByClassName('link');
    
    hamburger.addEventListener( 'click' , toggleMenu );
    
    for(var i = 0; i < menuLinks.length; ++i) {
        var menuLink = menuLinks[i];
        menuLink.addEventListener( 'click' , toggleMenu );
    }
}
              
            
!
999px

Console