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

            
              <link href="https://fonts.googleapis.com/css?family=Roboto+Slab:700" rel="stylesheet">




<header id="top">
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span> 
      </button>
        
        <a class="navbar-brand" href="#top">Martín Comito</a>
      </div>
      <div class="collapse navbar-collapse" id="myNavbar">
        <ul class="nav navbar-nav navbar-right" data-target="#myNavbar">
          <li><a href="#section0"><span class="glyphicon glyphicon-user"></span> About</a></li>
          <li><a href="#section1"><span class="glyphicon glyphicon-flash"></span> Portfolio</a></li>
          <li><a href="#section2"><span class="glyphicon glyphicon-envelope"></span> Contact</a></li>
          
          
          </li>
        </ul>
      </div>
    </div>
  </nav>
</header>


<main>
  
  <div class="container-fluid">
 <section id="section0">
    <h2>About me</h2>
   <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur nisi delectus quo eligendi earum eos sint, dolor velit maxime dignissimos impedit accusantium iste quis accusamus veritatis, expedita, quam nostrum odio.</p>
   
  </section>
  <hr>
  <section id="section1">
    <h2>Portfolio</h2>
  </section>
  <hr>
  <section id="section2">
    <h2>Get in touch</h2>
  </section>
    
  </div>
</main>

            
          
!

CSS

            
              html,
nav>.container-fluid {
  margin: 0 auto;
  max-width: 1000px;
  min-width: 280px;
}

body {
  background-color: #222;
  color: #eee;
  font-size: 16px;
  height: 100%;
  padding: 70px 0;
  position: relative;
}

a.navbar-brand {
  white-space: nowrap;
font-family: 'Roboto Slab', serif;
  font-size: 30px;
}
  
.navbar-brand,
.navbar-nav li a {
    line-height: 90px;
    height: 90px;
    padding-top: 0;
font-family: 'Roboto Slab', serif;
    font-size: 20px;

}
  
}

.navbar-collapse.in {
  max-height: none;
}

section {
  min-height: 100em;
  padding: 1em;
  
  
}

.collapsing {
  overflow-x: hidden;
}

#section0 {
  background-color: #2962ff;

}

#section1 {
  background-color: #2979ff;
}

#section2 {
  background-color: #448aff;
}

            
          
!

JS

            
              $(document).ready(() => {
  
  // set up scrollspy - only needed on codepen because they add the <body> tag for you
  $('body').attr({
    'data-spy': 'scroll',
    'data-target': '.navbar',
    'data-offset': '80'
  });

  //Ajusta la posición del scroll cuando estás navegando para guardar links desde otra página
  const scrollAdjust = () => scrollBy(0, -60);
  if (location.hash) scrollAdjust();
  window.addEventListener('hashchange', scrollAdjust);

  // Scroll suave
  $('a.navbar-brand, .navbar-nav li a:not(.dropdown-toggle)').on('click', (e) => {
    $('.collapse').collapse('hide'); // close mobile menu on click
    $('html, body').stop().animate({
      scrollTop: ($($(e.currentTarget).attr('href')).offset().top - 60)
    }, 1250, 'easeInOutExpo');
  });
  

});


            
          
!
999px

Console