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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <nav>
	<div class="container">
		<a href="#" class="logo">FlorinPop</a>
		<ul>
			<li><a href="#" class="active">Home</a></li>
			<li><a href="#">About</a></li>
			<li><a href="#">Services</a></li>
			<li><a href="#">Contact</a></li>
		</ul>
	</div>
</nav>

<div class="hero">
	<div class="container">
		<h1>Welcome to Page</h1>
		<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Et dignissimos, dolore harum molestiae.</p>
	</div>
</div>
<section class="container content">
	<h2>Content goes here</h2>
	<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quia reiciendis ea fugiat impedit delectus itaque corporis, quaerat quasi quo! Corrupti modi eius ipsum ratione omnis odio veritatis minus aspernatur labore quibusdam repudiandae distinctio magnam reiciendis dolore qui, sint officia aliquam quisquam expedita ipsa accusamus blanditiis delectus? Officiis, minus ut doloremque excepturi voluptatem ratione dignissimos illum consectetur dolor animi eveniet itaque tempore impedit, fugiat omnis saepe aliquid? Sit, illum dolorum dolorem repudiandae aut laborum enim unde vitae voluptates. Error, vitae ratione animi numquam dolore vel. Aperiam quo libero, facilis beatae exercitationem et corporis. Porro, maiores autem dolorem quod accusantium fuga fugit nulla optio quo iusto non voluptatum neque nemo ducimus obcaecati quia exercitationem velit itaque, temporibus aperiam accusamus delectus sunt qui culpa. Nobis saepe doloribus hic similique aperiam eveniet commodi nisi quis quibusdam assumenda quam iste sint, nihil magnam consectetur facilis? Eum saepe quos nam similique vero ullam est, ipsam excepturi, voluptas quaerat rerum dolor. Vel nostrum odio esse cum adipisci, fugit nam nulla omnis, laboriosam beatae est minima dicta deserunt accusantium mollitia, itaque ducimus consequuntur iure explicabo similique perferendis dolorum! Eligendi officiis suscipit iusto fugit nostrum sit, numquam quia quidem officia itaque repellendus reiciendis magnam corporis nisi, placeat quae ducimus.</p>

	<h3>More content</h3>
	<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ut eligendi adipisci ipsum beatae nobis debitis praesentium, facilis quidem numquam cumque incidunt quos alias sunt voluptates ad sit facere, perferendis quasi, aliquid enim laboriosam quod odit eaque. Obcaecati ab, voluptas inventore provident doloremque dolorem vitae pariatur repellendus labore numquam dolore quod?</p>
</section>

<footer>
	<p>
		Created with <i class="fa fa-heart"></i> by 
		<a href="http://florin-pop.com">Florin Pop</a>
		- More on
		<a target="_blank" href="https://github.com/florinpop17/work-journal">Github</a>
	</p>
</footer>
              
            
!

CSS

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

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

body {
	background-color: #fff;
	color: #222;
    font-family: 'Open Sans', 'Arial', sans-serif;
    padding-bottom: 50px;
}

nav {
    background-color: #222;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: all .3s ease-in-out;
}

nav.active {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.container {
    margin: 0 auto;
    max-width: 1200px;
}

nav .container {
    align-items: center;
    display: flex;
    padding: 20px 0;
    justify-content: space-between;
    transition: all .3s ease-in-out;
}

nav.active .container {
    padding: 10px 0;
}

nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style-type: none;
}

nav a {
    color: #fff;
    padding: 7px 15px;
    text-decoration: none;
    transition: all .3s ease-in-out;
}

nav li a:hover {
    background-color: #fff;
    color: #222;
}

nav.active a {
    color: #000;
    padding: 7px 10px;
}

nav.active li a:hover {
    background-color: #222;
    color: #fff;
}

nav a.active {
    background-color: #c0392b;
    color: #fff;
}

.hero {
    align-items: center;
    background-image: url('https://images.pexels.com/photos/450035/pexels-photo-450035.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260');
    background-size: cover;
    background-position: bottom center;
    color: #fff;
    display: flex;
    height: calc(100vh - 30px);
    justify-content: center;
    position: relative;
    text-align: center;
    z-index: -2;
}

.hero::before {
    content: ' ';
    background-color: rgba(0, 0, 0, 0.3);
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
}

.hero h1 {
    font-size: 46px;
    margin: -20px 0 20px;
}

.hero p {
    font-size: 20px;
    letter-spacing: 1px;
}

.content h2, .content h3 {
    font-size: 150%;
    margin: 10px 0;
}

.content p {
    color: #555;
    line-height: 30px;
    letter-spacing: 1.5px;
}

footer {
	background-color: #222;
	color: #fff;
	bottom: 0;
	position: fixed;
	left: 0;
	right: 0;
	letter-spacing: 1px;
	text-align: center;
}

footer p {
	margin: 10px 0;
}

footer i {
	color: red;
}

footer a {
	color: #3C97BF;
	text-decoration: none;
}

@media (max-width: 1200px) {
    .content {
        padding-left: 20px;
        padding-right: 20px;
    }
}
              
            
!

JS

              
                const nav = document.querySelector('nav');
window.addEventListener('scroll', fixNav);

function fixNav() {
    if(window.scrollY > nav.offsetHeight + 150) {
        nav.classList.add('active');
    } else {
        nav.classList.remove('active');
    }
}
              
            
!
999px

Console