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.

            
              .oop

.header
	h1.heading Pure CSS Navigation
		br
		small Simple & Easy, Scroll down to view

.mobile
	.mobile-body
		.navbar
			div.logo
				a(href="#") Grey Shades
			button(type="button", class="burger")
				span
				span
				span
			
			ul.menu
				li Home
				li Work
				li About
				li Contact Me
				
		.container
				
			h2 The Elephant Rope
			
			p As a man was passing the elephants, he suddenly stopped, confused by the fact that these huge creatures were being held by only a small rope tied to their front leg. No chains, no cages. It was obvious that the elephants could, at anytime, break away from their bonds but for some reason, they did not.

			p He saw a trainer nearby and asked why these animals just stood there and made no attempt to get away. “Well,” trainer said, “when they are very young and much smaller we use the same size rope to tie them and, at that age, it’s enough to hold them. As they grow up, they are conditioned to believe they cannot break away. They believe the rope can still hold them, so they never try to break free.”

			p The man was amazed. These animals could at any time break free from their bonds but because they believed they couldn’t, they were stuck right where they were.

			p Like the elephants, how many of us go through life hanging onto a belief that we cannot do something, simply because we failed at it once before?

			p Failure is part of learning; we should never give up the struggle in life.
            
          
!
            
              * {
	&, &:before, &:after {
		moz-box-sizing: border-box;
		box-sizing: border-box;
	}
}

@import url('https://fonts.googleapis.com/css?family=Inconsolata');

body {
	font-family: "Inconsolata", sans-serif;
	font-size: 14px;
	padding: 0 0 40px 0;
	margin: 0;
}

.mobile {
	width: 2.35in;
	height: 4.87in;
	margin: 0 auto;
	background: #222;
	border-radius: 25px;
	padding: 50px 5px;
	box-shadow: 0px 30px 40px rgba(0,0,0,0.2);
	
	.mobile-body {
		background: #fff;
		height: 100%;
		padding-top: 40px;
		// box-shadow: inset 0px 0px 2px rgba(0,0,0,1);
		border-radius: 4px;
		position: relative;
	}
}

.container {
	overflow-y: scroll;
	height: 327px;
	padding: 5px;
	background: #f6f6f6;
	line-height: 1.4;
	
	&::-webkit-scrollbar {
		width: 5px;
	}

	&::-webkit-scrollbar-track {
		-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
		border-radius: 10px;
	}

	&::-webkit-scrollbar-thumb {
		border-radius: 10px;
		-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
	}
}

// no of use
.oop {
	position: relative;
	z-index: auto;
	height: 10px;
	background: linear-gradient(141deg, #48ded4 0%, #a026bf 51%, #e82c75 75%);
	margin-bottom: 20px;
}

.header {
	height: 100vh;
	display: table;
	width: 100%;
}

.heading {
	display: table-cell;
	vertical-align: middle;
	font-size: 2.3em;
	letter-spacing: 5px;
	text-align: center;
	font-weight: 200;
	text-transform: uppercase;
	color: #333;
	position: relative;
	
	small {
		font-size: 50%;
	}
}

// navbar styles

.navbar {
	background: #fff;
	border-radius: 4px;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: 0px 1px 6px rgba(0,0,0,0.2);
	width: 100%;
	
	.logo {
		padding: 12px 5px 12px 35px;
		
		a {
			text-decoration: none;
			color: #333;
			font-size: 1em;
		}
	}
	 
	// instead button you can use checkbox to toggle menu with same click. I'm using button focus state to open the menu.
	
	button.burger {
		position: absolute;
		left: 0;
		top: 0;
		border: 0;
		background: transparent;
		padding: 8px 15px;
		pointer: cursor;
		outline: none;
		span {
			display: block;
			width: 4px;
			height: 4px;
			background: #000;
			margin: 3px 0;
			border-radius: 4px;
			transition: all .4s ease-in-out;
		}
		
		// Rotate first and last span
		
		&:focus {
			span:first-child {
				transform-origin: 2px 9px;
				transform: rotate(-90deg);
			}
			span:last-child {
				transform-origin: 2px -5px;
    			transform: rotate(-90deg);
			}
		}
		
		&:focus + ul {
			max-height: 500px;
		}
	}
	
	// nav menu
	
	ul.menu {
		list-style: none;
		padding: 0;
		margin: 0;
		overflow: hidden;
		max-height: 0;
		transition: all 0.6s ease-in-out;
		
		> li {
			display: block;
			padding: 10px 15px;
			transition: all 0.2s ease;
			
			&:hover {
				background: linear-gradient(141deg, #48ded4 0%, #a026bf 51%, #e82c75 75%);
				color: #fff;
			}
		}
	}
}

// feel free to modify. Thanks for watching :)
            
          
!
999px
Close

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.

Go PRO

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

Console