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

              
                <div class="page">
  <div class="logo"><span>DB</span> Consulting</div>
  <div class="home">
    <div class="welcome">
      <h1>DB Consulting</h1>
      <p>Aidez-nous à vous aider</p>
      <p>
        <a href="#services" class="btn btn-light">Nos services</a>
        <a href="#contacts" class="btn btn-light">Contactez-nous</a>
      </p>
    </div>
  </div>
  <div class="services" id="services">
    <h2>Nos services</h2>
    <div>
      <div class="service-block">
        <div class="service-img"></div>
        <h3>Adipiscing elit</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mollis dapibus nulla ac consectetur. Etiam vehicula, ante vel interdum accumsan, elit odio gravida tortor, eu faucibus dolor lacus sed eros. </p>
      </div>
      <div class="service-block">
        <div class="service-img"></div>
        <h3>Fusce et sodales lectus</h3>
        <p>Fusce et dictum sodales lectus, vitae congue odio. Ut pharetra, nibh dictum euismod euismod, est ante tempor justo, non elementum nunc elit vel eros. Sed fringilla, lectus molestie mollis gravida.</p>
      </div>
      <div class="service-block">
        <div class="service-img"></div>
        <h3>Quisque venenatis</h3>
        <p>libero lacus tempus est, a congue quam est eget lorem. Vivamus ultricies eros ligula, eget placerat est fermentum porta. Cras in facilisis lectus. Aliquam ultricies risus non tortor.</p>
      </div>
    </div>
  </div>
  <div class="contacts" id="contacts">
    <h2>Contactez-nous</h2>

    <form method="get">
      <label for="nom">Votre nom et votre prénom</label>
      <input type="text" name="nom" id="nom">

      <label for="telephone">Votre téléphone</label>
      <input type="text" name="telephone" id="telephone">

      <label for="sujet">Sujet de votre message</label>
      <input type="text" name="sujet" id="sujet">

      <label for="message">Sujet de votre message</label>
      <textarea name="message" id="message"></textarea>

      <input class="btn" type="submit" name="submit" value="Envoyer">
    </form>

  </div>
  <footer>
    &copy; 2018 Oueb De Veloper | Tous droits réservés
  </footer>
</div>
              
            
!

CSS

              
                $txt-default: #333;
$color1: #00c1db;
$color2: #008da0;

@mixin gradient-radial($color1, $color2) {
  background: $color1;
  background: -moz-radial-gradient(
    center,
    ellipse cover,
    $color1 0%,
    $color2 100%
  );
  background: -webkit-radial-gradient(
    center,
    ellipse cover,
    $color1 0%,
    $color2 100%
  );
  background: radial-gradient(ellipse at center, $color1 0%, $color2 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(
      startColorstr="#{$color1}",
      endColorstr="#{$color2}",
      GradientType=1
    );
}

@import url("https://fonts.googleapis.com/css?family=Raleway:400,700");

html,
body {
  padding: 0px;
  margin: 0px;
  font-family: "Raleway", sans-serif;
  color: $txt-default;
  font-size: 16px;
}

.logo {
  position: absolute;
  font-size: 1.6rem;
  line-height: 3rem;
  padding: 10px 4rem;

  span {
    position: fixed;
    display: inline-block;
    top: 10px;
    left: 10px;
    color: $color2;
    background-color: #fff;
    width: 3rem;
    height: 3rem;
    text-align: center;
    border-radius: 50%;
    border: 1px solid $color2;
  }
}

.btn {
  border: 1px solid #fff;
  color: #fff;
  padding: 0.5rem 1rem;
  margin: 0 0.3rem;
  border-radius: 0.2rem;
  text-decoration: none;
}

.home {
  min-height: 500px;
  height: 100vh;
  padding: 4rem 4rem;
  box-sizing: border-box;
  @include gradient-radial($color1, $color2);
  display: flex;
  flex-direction: column;

  .welcome {
    margin: auto;
    width: 100%;
    text-align: center;
    color: #fff;

    h1 {
      border-bottom: 2px dotted #fff;
      margin: 0 0 2rem 0;
      padding: 0 0 2rem 0;
      font-size: 3rem;
    }
  }
}

.services {
  padding: 4rem 4rem;

  h2 {
    color: $color2;
  }

  & > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .service-block {
    width: 30%;
    min-width: 280px;
    margin: 1.5%;
    box-sizing: border-box;

    h3 {
      color: $color2;
      text-align: center;
    }

    .service-img {
      background-color: #ccc;
      height: 150px;
    }
  }
}

.contacts {
  padding: 4rem 4rem;
  background-color: #ddd;

  form {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;

    label {
      margin: 1rem 0;
    }
    input,
    textarea {
      border: 1px solid $color2;
      padding: 10px;
      border-radius: 5px;
    }
    textarea {
      height: 15rem;
    }
    input:focus,
    textarea:focus {
      border: 1px solid #fff;
      padding: 10px;
      border-radius: 5px;
      background-color: lighten($color2, 5%);
      color: #fff;
    }
    input[type="submit"] {
      background-color: $color2;
      width: 25%;
      margin: 1rem auto;
    }
  }
}

footer {
  padding: 1rem 4rem;
  background-color: darken($color2, 15%);
  color: $color2;
  text-align: center;
  font-size: 0.8rem;
}

              
            
!

JS

              
                $(document).ready(function() {
  $('a[href^="#"]').click(function() {
    var id = $(this).attr("href");
    if (id === "#") {
      return ;
    }
    $("html, body").animate(
      {
        scrollTop: $(id).offset().top
      },
      "slow"
    );
  });
});

              
            
!
999px

Console