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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet prefetch" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="FreeCodeCamp.css">
</head>

<body id="about" data-spy="scroll" data-target=".navbar" data-offset="50">
<section id="contact">          
<div id="contactFlex">
<form id="contactForm" novalidate="">
                    <div class="form-item">
                        <input class="input" id="name" type="text" placeholder="Name" required="" />
                        <label class="label" id="label" for="“name”" >Name</label>
                    </div>
                    <div class="form-item">
                        <input class="input" id="email" type="email" placeholder="Email Address" required="" /> 
                        <label class="label" for="“email”">Email Address</label>
                    </div>
                    <div class="form-item">
                        <input class="input" id="phone" type="tel" placeholder="Phone Number" required="" /> 
                        <label class="label" for="“phone”">Phone Number</label>
                    </div>
                    <div class="form-item">
                        <label class="label" for="“message”">Message</label>
                        <textarea class="input" id="message" rows="5" placeholder="Message" required=""></textarea>
                    </div>
                    <br/>
                    <button>Send</button>
                </form>
               
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="Javascript.js"></script>
</body>

</html>
            
          
!

CSS

            
              * {
    font-family: sans-serif;
    margin: 0 auto;
    box-shadow: border-box;
    position: relative;
    box-sizing: border-box
}

body {
    left: 0;
    right: 0;
    margin: 0;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
    background: #898989;
}

#container {
    width: 1030px;
}

a {
    text-decoration: none;
    outline: 0!important;
    border: 0!important
}

a:hover {
    text-decoration: none;
    outline: 0!important;
    border: 0!important
}

li {
    list-style: none
}

img {
    left: 0;
    width: 100%;
    height: auto
}

#menuFix {
    top: 0;
    position: fixed;
    display: flex!important;
    background: #722872;
    width: 100%;
    right: 0;
    height: 70px;  
    line-height: 70px
}

#menuFix ul {
    margin: 0 auto;
    left: 0;
    right: 0;
}

#menuFix li {        
    letter-spacing: 2px;       
}


#menuFix li a{
    background-color: transparent;
    color: #888;
    top: 1.6em;
    font-size: .9em;
    font-weight: 600;
    top: 10px;
}

#menuFix li a:hover {
    text-decoration: none;
    box-shadow: 1px 2px 2px 0px #4a4949;
    color: #666;
}

#menuFix li a span {  
    padding: 12px 20px;
}

#menuFix img {
    width: 3%;
    height: 60%;
    top: 12px;
}

.nav>li>a {
    top: 15px!important;
    position: relative;
    padding: 8px 0px;
}
.navbar-nav>.active>a span,
 .navbar-nav>.active>a span:focus,
 .navbar-nav>.active>a:hover{
    background-color: #f2f2f2!important;
    box-shadow: none!important;
}

#myDescript {
    margin-top: 0px;
    width: 100%;
    top: 0;
    padding: 140px 50px 50px;
    display: flex;
    background: #b5b5b5;
    color: #fff;
    font-size: 1.55em;
    text-align: center
}

#myDescript p {
    width: 660px;
}

#myDescript p:nth-of-type(2) {
    position: relative;
    width: 100%;

}

#myDescript img {
    width: 26%;
    top: -40px;
    height: 26%;
    border-radius: 150%
}


#myDescript hr {
    width: 60%;
    font-weight: 900;
}

#sec1 {
    padding: 10px 0 30px;
    text-align: center;
    background: #edecec
}

#sec1 img {
    width: 40%;
    height: auto;
    margin: 20px;
}

#sec1 h2 {
    color: #9b9b9b;
    font-weight: 700
}

#contact {
    border-top: 2px solid rgba( 132, 132, 132, 0.247 );
    padding: 10px;
    text-align: center;
    background: #edecec
}

#contact h2 {
    text-align: center;
    font-family: sans-serif;
    color: #7a7a7a;
}


.hr1 {
    margin: 40px 1.8% 30px 3.8%!important;
    padding: 0;
    left: 4.3em;
    width: 60%!important;
    border-bottom: 4px solid #fff!important;
    color: transparent!important;
    border-bottom: solid 5px #898989;
    text-align: center;
    white-space: nowrap;
}

.hr1::after {
    content: '\f121';
    font-family: FontAwesome;
    position: relative;    
    color: #fff!important;
    top: -.7em;
    left: 67.2%;
    font-size: 2em;
    font-weight: 500;
    white-space: nowrap;
}

.div1 {    
  display: flex 
} 

.hr {
    margin: 40px 3.8% 30px;
    padding: 0;    
    float: left;
    left: 15.25em;
    max-width: 272px;
    width: 22%;
    border: 0;
    border-bottom: solid 5px #898989;
    text-align: center;
}

.hr-NotAfter::after {
    content: '\f121';
    font-family: FontAwesome;
    float: right;
    margin: -.7em -1.42em 0 0;
    color: #7a7a7a;
    font-size: 3em;
    font-weight: 500;
}

#contact {
    padding-bottom: 80px
}

form {
    width: 40%;
    margin-left: 60px;
}

form .row:first-child .form-item {
    border-top: 1px solid #fff;
}

.form-item {
    position: relative;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #bbb;
}

.form-item input,
.form-item textarea {
    z-index: 1;
    position: relative;
    padding-right: 0;
    padding-left: 0;
    border: solid;
    bottom: -25px;
    border-radius: 0;
    font-size: 2.2em;
    background: 0 0;
    box-shadow: none!important;
    width: 100%;
    -webkit-transition: bottom .4s ease, opacity .7s ease;
    transition: bottom .4s ease, opacity .7s ease;
}

.form-item:last-of-type textarea{
    bottom:-18px
}

.form-item input:focus,
.form-item textarea:focus {
    outline: 0
}

label {
    display: inline-block;
    z-index: 2;
    position: relative;
    bottom: 1em;
    margin: 0;
	padding: 0;
	left: -8.3975em;
	right: 0;
    font-size: 1.5em!important;
    line-height: 1.764705882em;
    font-weight: 700;
    vertical-align: baseline;
    color: #722872;
    opacity: 0;
    -webkit-transition: bottom .4s ease, opacity .7s ease;
    transition: bottom .4s ease, opacity .7s ease;
}

.form-item-filled label {
    top: -30px;
    opacity: 1;
    color: #aaa;
}

#contactFlex {
    display: flex;
    top: 50px
}

#contactFlex > div {
    width: 40%;
    font-size: 1.5em;
    color: #686868;
    text-align: left
}

form button {
    bottom: 20px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 1.3em;
    color: #7a7a7a
}

#contact > p {
    text-align: right;
    right: 7.5%;
    font-size: 1.4em;
    font-weight: 500;
    color: #7e7b7b
}

footer {
    width: 100%;
    height: 13em;
    background-color: #a8a8a8;
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    color: #e0e0e0
}

#footFlex {
    width: 80%;
    display: flex;
}

#footFlex > div:not(p){
    margin-top: 6%!important
}

#footFlex ul {
    display: flex;
    margin-right: 40px;
    width: 100%;
}

#footFlex li {
    border: 2px solid #fff;
    border-radius: 50%;
    padding: 10px;
    margin: 2px;
    cursor: pointer;
    transition: all .5s;
}

#footFlex li:hover{
    background-color: #fff;
}

#footFlex li:hover i{
    color: #722872;
}

#footFlex li i:hover{
    background-color: transparent;
}

#footFlex li i{
    transition: all .5s;
    color: #fff
}

#footFlex div:first-child p:nth-child(2){
    width: 65%;
    left: 17.5%
}

#footFlex div p:nth-child(1){
    font-size: 1.3em
}

#footFlex div:first-child p:nth-child(2) a{
    color: #722872;
    font-weight: 400;
}

#footFlex div:first-child p:nth-child(2) a:hover {
    border-bottom: 2px solid #722872!important
}

#footFlex div:first-child p:first-child, #footFlex div:nth-child(2) p:first-child {
    margin-bottom: 1em
}

footer + div {
    height: 5.6em;
    background-color: #722872;
    font-size: 1.4em;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 5.6em;
    text-align: center
}



            
          
!

JS

            
              var w = document.querySelectorAll('.form-item'),
    x = document.querySelectorAll('.label'), //label com ID label
    z = document.querySelectorAll('.input'); //input com ID name
function myFunction() {
    'use strict';
    if (this.value !== "" ) {
        this.style.opacity = '1';
        this.style.bottom = '2em';
        this.style.color = '#722872';
        console.log(this);
    } else {
        this.style.opacity = '.4';
        this.style.bottom = '.5em';
        console.log(this);
    }
}

function seBlur() {
    if (z.value !== "") {
        this.style.color = "#A2A2A2";
    }
}

function sefocus() {
    if (z.value !== "") {
        this.style.color = "#722872";
    }
}

function execute() {
    if (z.length) {
        for (var i = 0; i < z.length; i++) {
            z[i].addEventListener("input", myFunction);
            z[i].addEventListener("blur", seBlur);
            z[i].addEventListener("focus", sefocus);
        }
    }
}
execute();

            
          
!
999px

Console