Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <div id="page">
	<div class="text-center">
		<h1>Menus</h1>

		<p>Nothing to see here, just a pure CSS fade-in/fade-out menu. No big woop.</p>

		<a class="btn" href="#menu-fade">Open Menu</a>
	</div>

	<div class="menu menu--fade" id="menu-fade">
		<div class="menu__content">
			<h3>Menu</h3>

			<ul>
				<li>Link 1</li>
				<li>Link 2</li>
				<li>Link 3</li>
				<li>Link 4</li>
				<li>Link 5</li>
				<li>Link 6</li>
				<li>Link 7</li>
			</ul>

			<a href="#page" class="menu__close"></a>
		</div>
	</div>
</div>
              
            
!

CSS

              
                // Variables

/*
 * IE 9 & IE 10 do not support rem units when used in the font shorthand property
 * (the entire declaration is ignored) or when used on pseudo elements.
 */

$line-height: 1.5rem;
$selection-color: #b3d4fc;
$base-font-color: #efefef;

// Mixins
@mixin box-sizing($type) {
  -webkit-box-sizing: $type;
     -moz-box-sizing: $type;
      -ms-box-sizing: $type;
       -o-box-sizing: $type;
          box-sizing: $type;
}

// Placeholders
%ruled-lines {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAEElEQVQImWNgoD/oUXBrAAAEFAFzGDmq2wAAAABJRU5ErkJggg==");
}

/* ==========================================================================
   Base
   ========================================================================== */

@import url(https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700);

*,
*:before,
*:after {
  @include box-sizing(border-box);
  margin: 0;
  padding: 0;
}

html {
  font: normal 16px/1.5 Merriweather, serif;
  color: $base-font-color;
  height: 101%;
}

body {
  //@extend %ruled-lines;
  background-color: #efefef;
  padding: 1.5rem 3rem;
	background-image: url("http://www.lorempixel.com/1920/1080/city/2");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

/* Headings
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5 {
  font-weight: normal;
}

h1 {
  font-size: 4.1875rem;
  line-height: 4.5rem;
  margin-top: $line-height;
	color: #63beff;
}

h2 {
  font-size: 2.625rem;
  line-height: 3rem;
  margin-top: $line-height;
  margin-bottom: $line-height;
}

h3 {
  font-size: 1.625rem;
  line-height: 3rem;
  margin-top: $line-height;
}

h4 {
  font-weight: bold;
  font-size: 1rem;
  line-height: $line-height;
  margin-top: $line-height;
}

h5 {
  font-style: italic;
  font-size: 1rem;
  line-height: $line-height;
  margin-top: $line-height;
}

/* Links
   -------------------------------------------------------------------------- */

a:link,
a:visited,
a:focus,
a:hover,
a:active {
  text-decoration: none;
}

a:focus,
a:hover,
a:active {
  text-decoration: underline;
}

a:focus,
a:active {
  outline: none;
}

p,
ul,
ol,
dl,
pre,
table,
blockquote {
  margin-bottom: $line-height;
}

ul ul,
ol ol,
dl dl,
ul ol,
ul dl,
ol ul,
ol dl,
dl ul,
dl ol {
  margin-bottom: 0;
}

/* Lists
   -------------------------------------------------------------------------- */

dt {
  font-weight: bold;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::selection {
  background: $selection-color;
  text-shadow: none;
}

::-moz-selection {
  background: $selection-color;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset border.
 */

fieldset {
  border: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/*
 * Remove border from image links in IE <= 10
 */

a img {
  border: none;
}


/* ==========================================================================
   Layout
   ========================================================================== */

/* ==========================================================================
   Module
   ========================================================================== */

.btn {
	background: #63beff;
	color: #fff;
	padding: $line-height / 2 $line-height;
	border-radius: 5px;
}

.menu--fade {
	position: fixed;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  overflow: hidden;
	color: #222;
	-webkit-transition: opacity 0.5s, -webkit-transform 0.5s;
          transition: opacity 0.5s, transform 0.5s;
  -webkit-transform: scale(0.95);
      -ms-transform: scale(0.95);
          transform: scale(0.95);
	opacity: 0;
}

.menu__content {
	@extend .clearfix;
	background: white;
	width: 100%;
	height: 100%;
	text-align: center;
	position: relative;
}

.menu__content > ul {
	position: absolute;
	top: 50%;
	left: 50%;
	-webkit-transform: translate(-50%, -50%);
      -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
	text-align: left;
}

.menu__close {
	position: absolute;
	top: 0;
	right: 1rem;
	-webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
          transform: rotate(45deg);
	text-decoration: none;
	color: #000;
}

.menu__close:focus,
.menu__close:hover,
.menu__close:active {
    text-decoration: none;
}

.menu__close:after {
	content: "+";
	font-size: 2rem;
}

#menu-fade:target {
	-webkit-transform: scale(1);
      -ms-transform: scale(1);
          transform: scale(1);
  opacity: 1;
  width: 100%;
  height: 100%;
	padding: 1.5rem;
}

#page:target .menu--fade {
	-webkit-transition: opacity 0.5s, -webkit-transform 0.5s, width 0s ease 0.5s, height 0s ease 0.5s;
          transition: opacity 0.5s, transform 0.5s, width 0s ease 0.5s, height 0s ease 0.5s;
	padding: 1.5rem;
}

/* ==========================================================================
   Helpers
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 */

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
  content: " "; /* 1 */
  display: table; /* 2 */
}

.clearfix:after {
  clear: both;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *:before,
  *:after,
  *:first-letter,
  *:first-line {
    background: transparent !important;
    color: #000 !important; /* Black prints faster: http://www.sanbeiji.com/archives/953 */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  /*
   * Printing Tables:
   * http://css-discuss.incutio.com/wiki/Printing_Tables
   */

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
              
            
!

JS

              
                (function ($, root) {
  $('html').removeClass('no-js');
}(jQuery, this));
              
            
!
999px

Console