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

              
                <!-- NavBar Start -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark shadow-sm fixed-top" id="navbar">
  <div class="container-lg">
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
      <ul class="navbar-nav mx-auto">
        <li class="nav-item">
          <a href="https://www.freecodecamp.org/fccbb6cde73-f308-4887-8665-ea0ee446e724" target="_blank" id="profile-link"><i class="fab fa-free-code-camp fa-3x"></i></a>
        </li>
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="#welcome-section">Home</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#about">About</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#projects">Projects</a>
        </li>
      </ul>
    </div>
  </div>
</nav>
<button onClick="topFunction()" id="myBtn" title="Go to top"><i class="fas fa-arrow-up"></i></button>
<!-- NavBar End -->

<!-- Welcome section start -->
<div class="hero" id="welcome-section">
  <div class="container">
    <h1>John Doe</h1>
    <p>Front End Developer</p>
  </div>
</div>
<!-- Welcome section end -->

<!-- About Section Start -->
<div id="about" class="container mt-3 pb-5">
  <div class="post-heading text-center">
    <h3 class="display-4 fw-bold">About Me</h3>
    <hr class="w-50 mx-auto" />
  </div>
  <div class="row">
    <div class="col-lg-6 col-md-6 col-12">
      <img src="https://images.pexels.com/photos/91227/pexels-photo-91227.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260" class="img-fluid" alt="Profile Picture">
    </div>
    <div class="col-lg-6 col-md-6 col-12 pt-5">
      <h2>Wanna Know Me?</h2>
      <hr />
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quos numquam nam similique rerum nisi, incidunt, suscipit itaque, totam eum ullam sit eveniet commodi placeat quis a quae harum animi facere! Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint et voluptatem at natus tenetur deleniti nihil, porro, nulla voluptatum eos ex non autem eligendi corporis odio, officiis ullam nemo quod! Lorem ipsum dolor, sit amet consectetur adipisicing elit. Doloribus repudiandae impedit libero expedita quod a voluptates ex praesentium, ullam autem, repellendus dolorem fugiat rerum. Quod nam fuga atque voluptas provident.</p>
      <a href="#" class="text-white btn btn-success w-50">KNOW MORE</a>
    </div>
  </div>
</div>
<hr>
<!-- About Section End -->


<!-- Projects Section Start -->
<h2 class="display-4 fw-bold text-center mt-5">Projects</h2>
<hr class="mx-auto w-50">
<div id="projects" class="container mt-3 mb-5" style="text-align: center;">
  <div class="post-heading text-center">
    <hr class="w-50 mx-auto" />
  </div>

  <div class="row mx-auto">
    <div class="col-lg-4 col-md-3 col-12 pb-5 pb-5">
      <div class="card project-tile" style="width: 18rem;">
        <img src="https://hasanarmstrong.com/assets/img/portfolio/pingpong.png" class="card-img-top" alt="...">
        <div class="card-body">
          <h5 class="card-title">Pong Game</h5>
          <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
          <a href="http://www.pingponggame.rf.gd/" class="btn btn-dark w-100" target="_blank">Live Demo</a>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- Projects Section End -->
<footer class="text-center text-white" style="background-color: #f1f1f1;">
  <!-- Grid container -->
  <div class="container pt-4">
    <!-- Section: Social media -->
    <section class="mb-4">
      <!-- Facebook -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-facebook-f"></i
      ></a>

      <!-- Twitter -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-twitter"></i
      ></a>

      <!-- Google -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-google"></i
      ></a>

      <!-- Instagram -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-instagram"></i
      ></a>

      <!-- Linkedin -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-linkedin"></i
      ></a>
      <!-- Github -->
      <a
        class="btn btn-link btn-floating btn-lg text-dark m-1"
        href="#!"
        role="button"
        data-mdb-ripple-color="dark"
        ><i class="fab fa-youtube"></i
      ></a>
    </section>
    <!-- Section: Social media -->
  </div>
  <!-- Grid container -->

  <!-- Copyright -->
  <div class="text-center text-dark p-3" style="background-color: rgba(0, 0, 0, 0.2);">
    © 2020 Copyright:
    <a class="text-dark" href="#">Swarnodip Sinha</a>
  </div>
  <!-- Copyright -->
</footer>



              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Lato&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Ubuntu&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Raleway&display=swap");

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: "Lato", sans-serif;
}

/* Navbar styles*/
.navbar {
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.2rem;
  background: #222222 !important;
  padding: 20px 0;
}

.navbar-dark .navbar-nav .nav-link {
  color: #fff;
  padding-left: 20px;
}

.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link:hover {
  color: #c0392b;
  transition: all 0.3s ease-in-out;
}

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

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

.hero h1 {
  font-size: 5em;
  margin: -20px 0 20px;
  font-family: "Ubuntu";
}

.hero p {
  font-size: 1.2em;
  letter-spacing: 2px;
  color: #ccc;
  font-family: "Montserrat";
}

#welcome-section h1 {
  font-family: monospace;
}

#myBtn {
  position: fixed;
  right: 10px;
  bottom: 10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e62739;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  border: none;
  outline: none;
  cursor: pointer;
  z-index: 2;
}
#myBtn:active {
  background: #cc2333;
}

#projects {
  margin: auto;
  display: flex;
  justify-content: center;
}

#profile-link {
  color: #fff;
  position: absolute;
  left: 50px;
}

footer{
 bottom: 0;
}
.footer-distributed{
 background-color: #292c2f;
 box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
 box-sizing: border-box;
 width: 100%;
 text-align: left;
 font: bold 16px sans-serif;
 
 padding: 55px 50px;
 margin-top: 80px;
}
 
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
 display: inline-block;
 vertical-align: top;
}
 
.footer-distributed .footer-left{
 width: 40%;
}
 
.footer-distributed h3{
 color:  #ffffff;
 font-family: 'Raleway';
 margin: 0;
}
 


.footer-distributed .footer-company-name{
 color:  #8f9296;
 font-size: 14px;
 font-weight: normal;
 margin: 0;
}

.footer-distributed .footer-center{
 width: 35%;
}
 
.footer-distributed .footer-center i{
 background-color:  #33383b;
 color: #ffffff;
 font-size: 25px;
 width: 38px;
 height: 38px;
 border-radius: 50%;
 text-align: center;
 line-height: 42px;
 margin: 10px 15px;
 vertical-align: middle;
}
 
.footer-distributed .footer-center i.fa-envelope{
 font-size: 17px;
 line-height: 38px;
}
 
.footer-distributed .footer-center p{
 display: inline-block;
 color: #ffffff;
 vertical-align: middle;
 margin:0;
}
 
.footer-distributed .footer-center p span{
 display:block;
 font-size:14px;
 line-height:2;
}
 
.footer-distributed .footer-center p a{
 color:  #5383d3;
 text-decoration: none;;
}
 
.footer-distributed .footer-right{
 width: 20%;
}
 
.footer-distributed .footer-company-about{
 line-height: 20px;
 color:  #92999f
 font-size: 13px;
 font-weight: normal;
 margin: 0;
}
 
.footer-distributed .footer-company-about span{
 display: block;
 color:  #ffffff;
 font-size: 14px;
  font-family: 'Montserrat';
 margin-bottom: 20px;
}
 
.footer-distributed .footer-icons{
 margin-top: 25px;
}
 
.footer-distributed .footer-icons a{
 display: inline-block;
 width: 35px;
 height: 35px;
 cursor: pointer;
 background-color:  #33383b;
 border-radius: 2px;
 
 font-size: 20px;
 color: #ffffff;
 text-align: center;
 line-height: 35px;
 
 margin-right: 3px;
 margin-bottom: 5px;
}
 
 
@media (max-width: 880px) {
 
 .footer-distributed{
 font: bold 14px sans-serif;
 
 }
 
 .footer-distributed .footer-left,
 .footer-distributed .footer-center,
 .footer-distributed .footer-right{
 display: block;
 width: 100%;
 margin-bottom: 40px;
 text-align: center;
 }
 
 .footer-distributed .footer-center i{
 margin-left: 0;
 }
}

@media only screen and (max-width: 768px) {
  #profile-link {
    display: none;
  }
}


              
            
!

JS

              
                $(document).ready(function () {
  $("ul li a").click(function () {
    $("li a").removeClass("active");
    $(this).addClass("active");
  });
});

let mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () {
  scrollFunction();
};
function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    mybutton.style.display = "block";
  } else {
    mybutton.style.display = "none";
  }
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}
              
            
!
999px

Console