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

              
                <!doctype html>
<html>
<head>
<title>Document sans nom</title>
</head>
<body>
<form>
  <fieldset>
    <legend>Civilité</legend>
    <p>
      <label for="nom">Nom de famille</label>
      <input type="text" id="nom" placeholder="Votre nom" required/>
    </p>
    <p>
      <label for="prenom">Prénom</label>
      <input type="text" id="prenom" placeholder="Votre prénom" required/>
    </p>
    <p>
      <label for="datenaissance">Date de naissance</label>
      <input type="date" id="datenaissance"/>
    </p>
  </fieldset>
  <fieldset>
    <legend>Autre groupe de champ</legend>
    <p>
      <label for="champtextelarge">Un champ mulitiligne</label>
      <textarea id="champtextelarge" required></textarea>
    </p>
    <p>
      <label for="listederoulante">Une liste déroulante</label>
      <select id="listederoulante">
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
      </select>
    </p>
  </fieldset>
  <p>
    <input type="submit" value="Valider"/>
  </p>
</form>
</body>
</html>

              
            
!

CSS

              
                /* Import d'un police*/
  @import url(https://fonts.googleapis.com/css?family=Itim);

  /* Style du form global */
  form { width:600px; margin:0 auto; font-family: 'Itim', cursive; line-height:120%}

  /* Style du fieldset */
  form fieldset { border: dashed 1px #333; padding:5px; margin-bottom:30px}

  /* Style de la legende */
  form legend{font-size:20px; padding:10px;background:#fff}

  /* Alignement des éléments de formulaire */
  form p label{ width:48%; float:left; display:block; text-align:right; padding-right:1%}
  form p input, form p select, form p textarea{ width:48%; float:left; display:block; text-align:left; padding-left:2%}

  /* Annulation des flottements label/input */
  form p{width:auto; overflow:hidden; }

  /* Style arrondi et bordure des éléments de formulaires */
  form p input, form p select, form p textarea	{
  border-radius: 5px;
  border:solid 1px #000; padding-top:5px; padding-bottom:5px}

  /* Style du bouton de validation */
  form input[type=submit]{ display:block; max-width:50%; padding:5px; text-align:center; margin:0 auto; float:none; padding:10px;font-size:22px;background:blue; color:#fff  }

  /* Style du placeholder*/
  ::-webkit-input-placeholder {font-family: 'Itim', cursive;font-family: 'Itim', cursive; color:#ccc; }
  ::-moz-placeholder { font-family: 'Itim', cursive;color:#ccc; } /* firefox 19+ */
  :-ms-input-placeholder { font-family: 'Itim', cursive;color:#ccc; } /* ie */
  input:-moz-placeholder { font-family: 'Itim', cursive;color:#ccc; }
  /* Styles indicatifs état des champs avant/après validation */
:required {
border-color: red; 
}

@media screen and (max-width: 600px) {
  
/* Style du form global : on passe en largeur relative : % */
form { width:90%; margin:0 5%; }
/* Style pour éviter que les bordures s'additionnent à la largeur définie */
 * {
        -webkit-box-sizing: border-box;
           -moz-box-sizing: border-box;
                box-sizing: border-box;
    }
    
/* Alignement des éléments de formulaire : on passe les labels et champs de formulaire les uns en dessous des autres */
form p label{ width:100%; float:none; text-align:left; padding-right:0%; padding-bottom:5px}
form p input, form p select, form p textarea{ width:98%;  float:none; display:block; text-align:left; padding:5px 1%}
  
}
              
            
!

JS

              
                
              
            
!
999px

Console