cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

  <!-- Fixed navbar -->
  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark compensate-for-scrollbar">
    <a class="navbar-brand" href="#">Fixed navbar</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    <div class="collapse navbar-collapse" id="navbarCollapse">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item active">
          <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
        <li class="nav-item">
          <a class="nav-link" href="#">Link</a>
        <li class="nav-item">
          <a class="nav-link disabled" href="#">Disabled</a>
      <form class="form-inline mt-2 mt-md-0">
        <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>

<main role="main" class="container">
  <h2 class="mt-5">fancyBox v3.3 - Fix element jumping</h2>

    Add <code>compensate-for-scrollbar</code> class to elements that expands while fancybox opens.
    <br />
    In this demo, this class is apllied to <code>&lt;nav&gt;</code> element, remove to see the difference.

    <hr class="my-5" />
  <p class="imglist">
    <a href="https://source.unsplash.com/ndjyaOp0fOc/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/ndjyaOp0fOc/240x160" />

    <a href="https://source.unsplash.com/A-fubu9QJxE/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/A-fubu9QJxE/240x160" />

    <a href="https://source.unsplash.com/rkkr6-2I4sg/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/rkkr6-2I4sg/240x160" />

    <a href="https://source.unsplash.com/mr_Tg4SI66A/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/mr_Tg4SI66A/240x160" />

    <a href="https://source.unsplash.com/YEsedBccUEA/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/YEsedBccUEA/240x160" />

    <a href="https://source.unsplash.com/Hw62tzAkXXE/1600x900" data-fancybox="group1" data-type="image">
      <img src="https://source.unsplash.com/Hw62tzAkXXE/240x160" />

Loading ..................