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 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 class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#pages">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#about">Dinesh</a>
    </div>
    <div class="collapse navbar-collapse" id="pages">
      <ul class="nav navbar-nav pull-right">
        <li><a href="#about">About</a></li>
        <li><a href="#portfolio">Portfolio</a></li>
        <li><a href="#contact">Contact</a></li>
      </ul>
    </div>
  </div>
</nav>
<div class="container">
  <div id="about" class="well emphasize-dark">
    <div class="pageContent">
      <img class="img-responsive img-circle portrait" src="https://cdn2.iconfinder.com/data/icons/male-users-2/512/13-512.png" alt="Dinesh" />
      <p>My name is Dinesh. I love programming. Follow these links to check out my code! <br/>
        <a href="https://github.com/dinesh333" target="blank" class="btn btn-default btn-lg">
          <i class="fa fa-github" aria-hidden="true"></i> GitHub
        </a>
        <a href="https://www.freecodecamp.com/dinesh333" target="blank" class="btn btn-default btn-lg">
          <i class="fa fa-free-code-camp" aria-hidden="true"></i> Free Code Camp
        </a>
        <a href="https://codepen.io/dinesh333/" target="blank" class="btn btn-default btn-lg">
          <i class="fa fa-codepen" aria-hidden="true"></i> CodePen
        </a>
      </p>
    </div>
  </div>

  <div id="portfolio" class="well">
    <div class="pageContent">
      <h3>Portfolio</h3>
      <hr/>
      <div class="row">
        <div class="col-md-6">
          <p> Beatbox </p>
          <a href="https://github.com/dinesh333/Beatbox/blob/master/BeatBox.java" target="blank"><img src="https://s30.postimg.org/8hiy21a41/Beat_Box_Pic.png" class="img-rounded img-responsive" alt="BeatBox" /></a>
        </div>
        <div class="col-md-6">
          <p> Calculator </p>
          <a href="https://github.com/dinesh333/Calculator/blob/master/Calculator.java" target="blank"><img src="https://s30.postimg.org/vx5gl4j8x/Calculator_Pic.png" class="img-rounded img-responsive" alt="Calcultor" /></a>
        </div>
      </div>
    </div>
  </div>

  <div id="contact" class="well">
    <div class="pageContent">
      <h3>Contact me</h3>
      <hr/>
      <div class="col-md-12">
        <div class="form-area">
          <form role="form">
            <br style="clear:both">
            <div class="form-group">
              <input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
            </div>
            <div class="form-group">
              <input type="text" class="form-control" id="email" name="email" placeholder="Email" required>
            </div>
            <div class="form-group">
              <input type="text" class="form-control" id="mobile" name="mobile" placeholder="Mobile Number" required>
            </div>
            <div class="form-group">
              <input type="text" class="form-control" id="subject" name="subject" placeholder="Subject" required>
            </div>
            <div class="form-group">
              <textarea class="form-control" type="textarea" id="message" placeholder="Message" maxlength="140" rows="7"></textarea>
              <span class="help-block" id="characterLeft">You have reached the limit</span>
            </div>
            <button type="button" id="submit" name="submit" class="btn btn-primary pull-right">Submit Form</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .navbar-default {
  background-color: #4e0072;
  border-color: #e6e6e6;
}

.navbar-default .navbar-brand {
  color: #ffffff;
}

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
  color: #c29e06;
}

.navbar-default .navbar-text {
  color: #ffffff;
}

.navbar-default .navbar-nav > li > a {
  color: #ffffff;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #c29e06;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #c29e06;
  background-color: #e6e6e6;
}

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: #c29e06;
  background-color: #e6e6e6;
}

.navbar-default .navbar-toggle {
  border-color: #e6e6e6;
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background-color: #e6e6e6;
}

.navbar-default .navbar-toggle .icon-bar {
  background-color: #a6b300;
}

.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
  border-color: #ffffff;
}

.navbar-default .navbar-link {
  color: #ffffff;
}

.navbar-default .navbar-link:hover {
  color: #c29e06;
}

@media (max-width: 767px) {
  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
    color: #ffffff;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
    color: #c29e06;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
    color: #c29e06;
    background-color: #e6e6e6;
  }
}

.navbar-header,
#pages {
  text-transform: uppercase;
  font-weight: bold;
}

/*End navbar*/

#about,
#portfolio,
#contact,
.emphasize-dark {
  padding-top: 50px;
  padding-left: 50px;
  height: 670px;
  color: #fff;
  position: relative;
  box-shadow: 0 0 25px 5px rgba(0, 0, 0, .35);
}

#about {
  background-color: #888;
}

#portfolio {
  background-color: #586f0e;
}

#contact {
  background-color: #0b5182;
}

.portrait {
  margin: 0 auto;
}

h3 {
  font-size: 50px;
  text-align: center;
  font-weight: bold;
}

p {
  font-size: 30px;
  text-align: center;
}

.pageContent {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
}

img {
  width: 304px;
  height: 236px;
}

/*Form*/
.red {
  color: red;
}

.form-area {
  background-color: #FAFAFA;
  padding: 10px 40px 60px;
  border: 1px solid GREY;
}

              
            
!

JS

              
                $(document).ready(function(){
  // Add smooth scrolling to all links
  $("a").on('click', function(event) {

    // Make sure this.hash has a value before overriding default behavior
    if (this.hash !== "") {
      // Prevent default anchor click behavior
      event.preventDefault();

      // Store hash
      var hash = this.hash;

      // Using jQuery's animate() method to add smooth page scroll
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 800, function(){
   
        // Add hash (#) to URL when done scrolling (default click behavior)
        window.location.hash = hash;
      });
    } // End if
  });
});

$(document).ready(function(){ 
    $('#characterLeft').text('140 characters left');
    $('#message').keydown(function () {
        var max = 140;
        var len = $(this).val().length;
        if (len >= max) {
            $('#characterLeft').text('You have reached the limit');
            $('#characterLeft').addClass('red');
            $('#btnSubmit').addClass('disabled');            
        } 
        else {
            var ch = max - len;
            $('#characterLeft').text(ch + ' characters left');
            $('#btnSubmit').removeClass('disabled');
            $('#characterLeft').removeClass('red');            
        }
    });    
});

              
            
!
999px

Console