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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <form>
   <h1>Form Validation With CSS (No JavaScript)</h1>
   <div class="item">
      <input type="text" placeholder="Company" unchecked />
      <span class="validation-tag"></span>
   </div>
   <div class="item">
      <input type="text" placeholder="Title (optional)" />
      <!--<span class="validation-tag"></span>-->
   </div>
   <div class="item">
      <input type="email" name="email" placeholder="Email" unchecked />
      <span class="validation-tag"></span>
   </div>
   <div class="item">
      <h3>How did you hear about us?</h3>
      <div class="radio-group">
         <input name="howhear" id="socialMedia" type="radio" required />
         <label for="socialMedia">Social Media</label> 
         <span class="validation-tag"></span>
 
         <input name="howhear" id="colleague" type="radio" required />
         <label for="colleague">Friend/Colleague</label>
         <span class="validation-tag"></span>
   
         <div class="break-mobile"></div>
         <input name="howhear" id="website" type="radio" required />
         <label for="website">Found our Website</label>
         <span class="validation-tag"></span>
      </div>
   </div>
   
   <div class="item">
      <h3>What languages do you use?</h3>
      <div class="radio-group">
         <input name="language" id="html" type="checkbox" />
         <label for="html">HTML</label> 
         <span class="validation-tag"></span>
 
         <input name="css" id="css" type="checkbox" />
         <label for="css">CSS</label>
         <span class="validation-tag"></span>
   
         <input name="language" id="javascript" type="checkbox" />
         <label for="javascript">Javascript</label>
         <span class="validation-tag"></span>
         
         <input name="language" id="php" type="checkbox" />
         <label for="php">PHP</label>
         <span class="validation-tag"></span>
         
         <div class="break-mobile"></div>
         <input name="language" id="python" type="checkbox" />
         <label for="python">Python</label>
         <span class="validation-tag"></span>
      </div>
   </div>
</form>
              
            
!

CSS

              
                $tomato: tomato;
$green:#55AA55;
$grayText: #555;
$dimGray: red;
$indigo:indigo;

html {
   box-sizing: border-box;
   font: 1em sans-serif;
   color:$grayText;
   background: radial-gradient(red, green, blue);
   height:100%;
   display:grid;
   align-content:center;
}

body{margin:0}

*, *:before, *:after {
  box-sizing: inherit;
}

form {
   width:100%;
   max-width:900px;
   //min-width:694px;
   padding:1.5em;
   color:$grayText;
   margin:3em auto;
   background:white;
   
   h1{
      text-align:center;
      margin-top:0;
   }
   
   .item {
      position:relative;
      margin-bottom:10px;
      
      h3{
         display:inline-block;
         font-size: 1.5em;
         margin: .5em 0;
      }
      
      .radio-group{
         .validation-tag{
            top:32px;
         }
         & > label:last-of-type{
            margin-right:0;
         }
         & .break-mobile{
            display:none;
         }
      }
      
      .validation-tag{
         display: inline-grid;
         grid-template-columns: .1fr .6fr;
         color: white;   
         position:absolute;
         right:0;
         top:17px;

         &:before{
            content:"";
            border-top: solid 13px transparent;
            border-bottom: solid 13px transparent;
            border-right: solid 16px;
            border-right-color: $tomato;
            transition: border-right-color 1.5s;
         }
         &::after{
            padding: 4px 12px 4px 2px;
            border-radius:2px 5px 5px 2px;
            line-height: 20px;
            background: $tomato; 
            content:"✘ Please Complete";                                                width:152px;
            transition: background 1.5s;
         }
      }  
      
      input{
         width: calc(100% - 180px);
         
         &[type=radio], &[type=checkbox]{
            width:auto;
            
            & + label{
               margin-right:3%;
            }
         }
         &[type=text], &[type=email]{
            font-size:1.6em;
            border:solid 2px gray;
            padding:.4em .3em;
            margin-bottom: .2em;

            &::placeholder{
               color:#BBB;
            }
         }
         
         &[type=email]:not(:placeholder-shown),
         &[type=text]:not(:placeholder-shown),
         &[type=radio]:checked,
         &[type=checkbox]:checked{
            & ~ .validation-tag{
               &:before {
                  border-right-color:$green;
               }
               &:after{
                  content: "✓  Complete";
                  background: $green;   
               }
            }
         }
             
         &[type=email]:invalid + .validation-tag{
            &::before {
               border-right-color:$indigo;
            }
            &::after{
               content: "✘ Invalid Email";
               background: $indigo;   
            }
         }
         
         &[type=radio]:checked + .validation-tag{
            transition:z-index 12s;
            z-index: 200;
         }
      }
   }
}

@media (max-width: 710px){
   
   input#python{
      clear:both;
   }
   
   form {
       padding: 1em;
     .item .radio-group .validation-tag{
         top: 54px;
      }
      
      .item .radio-group .break-mobile{
         display:block;
         margin-top:16px;
      }
   }
}
              
            
!

JS

              
                
              
            
!
999px

Console