Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="container">

    <form id="contact" name="contact">
      <ul>
        <li>
          <label></label>
          <input placeholder="Nom" type="text" id="name" name="nom" required/>
        </li>                    
        <li>
          <label></label>
          <input placeholder="Email" type="text" name="email" required/>
        </li>
        <li>
          <label></label>
          <input placeholder="Telephone" type="text" name="tel" required/>
        </li>
        <li>
          <label></label>
          <input placeholder="Entreprise" type="text" name="entreprise" id="entreprise" required/>
        </li>
        <li>
          <label></label>
          <textarea id="message" rows="5" cols="45" name="message" placeholder="Votre message" required></textarea>
        </li>
      </ul>
      <input class="submit" type="submit" value="Submit">
      
    </form>
  <div id="msgSubmit" class="hidden">
    <p class="blue">Merci ! Votre message est bien envoyé.<br/>
      Nous revenons vers vous dans les plus brefs délais.</p>
  </div>

              
            
!

CSS

              
                body{
 background: #f3eee4;
}
.container{
  padding:100px;
}
#contact{
  max-width:400px;
  padding:20px;
  background-color:#ffffff;
  margin:auto;
}
ul{
  list-style:none;
  padding:0;
  margin:0
}
input{
  border:1px solid #f7f7f7;
  border-radius:8px;
  padding:10px;
  width:100%;
}
textarea{
  border:1px solid #f7f7f7;
  width:100%;
  ouline:none
}
.hidden{
  display:none;
  visibility:hidden;
}
.error {
  color: #ff0000;
}
.submit{
  margin-top:30px;
  width:150px;
  margin:30px 0;
  background-color:black;
  color:white;
  background: #24C6DC;  /* fallback for old browsers */
  background: -webkit-linear-gradient(to right, #514A9D, #24C6DC);  /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to right, #514A9D, #24C6DC); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.mandatory{
		font-size:1.3em;
		margin: 50px 0;
		font-weight: normal;
  text-align:center;
}
              
            
!

JS

              
                
// Wait for the DOM to be ready
$(function() {
  // Initialize form validation on the registration form.
  // It has the name attribute "registration"
  $("form[name='contact']").validate({
    // Specify validation rules
    rules: {
      // The key name on the left side is the name attribute
      // of an input field. Validation rules are defined
      // on the right side
      nom: "required",
      prenom: "required",
      tel:{
       required: true,
      number: true
      },
      email: {
        required: true,
        // Specify that email should be validated
        // by the built-in "email" rule
        email: true
      },
      message:"required"
    },
    // Specify validation error messages
    messages: {
      nom: "veuillez insérer votre nom",
      prenom: "veuillez insérer votre prénom",
      entreprise:"veuillez indiquer une entreprise",
      tel: 'veuillez insérer un numéro de téléphone',
      email: "veuillez insérer une adresse mail valide",
      message:"veuillez remplir ce champ"
    },
    // Make sure the form is submitted to the destination defined
    // in the "action" attribute of the form when valid
    submitHandler: function(form) {
      form.submit();
    }
  });
});
 
              
            
!
999px

Console