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

              
                	<form class="topLabel">

		<header class="form-header">
			<h2>A Form of Fantasy</h2>
			<div class="quote">
				"The gift of fantasy has meant more to me than my talent for absorbing positive knowledge." <span>- Albert Einstein</span>
			</div>
		</header>

		<div class="form-progress">
			<div class="progress">
				<span id="progress-width"></span>
			</div>
		</div>

		<ul>
			<li class="form-section enabled">
				<div id="form-field-1" class="span_one_two">
					<fieldset>
						<legend>
							Which is better?
						</legend>
						<div>
							<span>
								<input id="Field1_0" name="Field1" type="radio" class="field radio" value="Fantasty" checked="checked" />
								<label class="choice" for="Field1_0" >
									Fantasty
								</label>
							</span>
							<span>
								<input id="Field1_1" name="Field1" type="radio" class="field radio" value="Sci-Fi" />
								<label class="choice" for="Field1_1" >
									Sci-Fi
								</label>
							</span>
							<span>
								<input id="Field1_2" name="Field1" type="radio" class="field radio" value="Don&#039;t make me choose!" />
								<label class="choice" for="Field1_2" >
									Don't make me choose!
								</label>
							</span>
							<span>
								<input id="Field1_3" name="Field1" type="radio" class="field radio" value="I don&#039;t like either" />
								<label class="choice" for="Field1_3" >
									I don't like either
								</label>
							</span>
						</div>
					</fieldset>
				</div>

				<div id="form-field-2" class="span_two_two">
					<label class="title" id="title2" for="Field2">
						How much would you donate to a Kickstarter to bring back Firefly?
					</label>
					<span class="symbol">$</span>
					<span>
						<input id="Field2" name="Field2" type="text" class="field text currency nospin" value="" size="10" />
						<label for="Field2">Dollars</label>
					</span>
					<span class="symbol radix">.</span>
					<span class="cents">
						<input id="Field2-1" name="Field2-1" type="text" class="field text nospin" value="" size="2" maxlength="2" />
						<label for="Field2-1">Cents</label>
					</span>
				</div>
			</li>

			<li class="likert form-section disabled">
				<table cellspacing="0">
					<caption class="title" id="title3">
						Rate the Star Wars movies
					</caption>
					<thead>
						<tr>
							<th>&nbsp;</th>
							<td>Didn't Like At All</td>
							<td>Meh</td>
							<td>Kinda Liked</td>
							<td>Loved!</td>
						</tr>
					</thead>
					<tbody>
						<tr class="statement3">
							<th>
								<label for="Field3">Episode I - The Phantom Menace</label>
							</th>
							<td title="Didn&#039;t Like At All">
								<input id="Field3_1" name="Field3" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field3_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field3_2" name="Field3" type="radio" value="Meh" />
								<label for="Field3_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field3_3" name="Field3" type="radio" value="Kinda Liked" />
								<label for="Field3_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field3_4" name="Field3" type="radio" value="Loved!" />
								<label for="Field3_4">4</label>
							</td>
						</tr>
						<tr class="alt statement4" id="form-field-3" >
							<th>
								<label for="Field4">Episode II - Attack of the Clones</label>
							</th>
							<td title="Didn&#039;t Like At All">
								<input id="Field4_1" name="Field4" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field4_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field4_2" name="Field4" type="radio" value="Meh" />
								<label for="Field4_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field4_3" name="Field4" type="radio" value="Kinda Liked" />
								<label for="Field4_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field4_4" name="Field4" type="radio" value="Loved!" />
								<label for="Field4_4">4</label>
							</td>
						</tr>
						<tr class="statement5" id="form-field-4" >
							<th><label for="Field5">Episode III - Revenge of the Sith</label></th>
							<td title="Didn&#039;t Like At All">
								<input id="Field5_1" name="Field5" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field5_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field5_2" name="Field5" type="radio" value="Meh" />
								<label for="Field5_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field5_3" name="Field5" type="radio" value="Kinda Liked" />
								<label for="Field5_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field5_4" name="Field5" type="radio" value="Loved!" />
								<label for="Field5_4">4</label>
							</td>
						</tr>
						<tr class="alt statement6" id="form-field-5" >
							<th>
								<label for="Field6">Episode IV - A New Hope</label>
							</th>
							<td title="Didn&#039;t Like At All">
								<input id="Field6_1" name="Field6" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field6_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field6_2" name="Field6" type="radio" value="Meh" />
								<label for="Field6_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field6_3" name="Field6" type="radio" value="Kinda Liked" />
								<label for="Field6_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field6_4" name="Field6" type="radio" value="Loved!" />
								<label for="Field6_4">4</label>
							</td>
						</tr>
						<tr class="statement7" id="form-field-6" >
							<th>
								<label for="Field7">Episode V - The Empire Strikes Back</label>
							</th>
							<td title="Didn&#039;t Like At All">
								<input id="Field7_1" name="Field7" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field7_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field7_2" name="Field7" type="radio" value="Meh" />
								<label for="Field7_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field7_3" name="Field7" type="radio" value="Kinda Liked" />
								<label for="Field7_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field7_4" name="Field7" type="radio" value="Loved!" />
								<label for="Field7_4">4</label>
							</td>
						</tr>
						<tr class="alt statement8" id="form-field-7" >
							<th>
								<label for="Field8">Episode VI - Return of the Jedi</label>
							</th>
							<td title="Didn&#039;t Like At All">
								<input id="Field8_1" name="Field8" type="radio" value="Didn&#039;t Like At All" />
								<label for="Field8_1">1</label>
							</td>
							<td title="Meh">
								<input id="Field8_2" name="Field8" type="radio" value="Meh" />
								<label for="Field8_2">2</label>
							</td>
							<td title="Kinda Liked">
								<input id="Field8_3" name="Field8" type="radio" value="Kinda Liked" />
								<label for="Field8_3">3</label>
							</td>
							<td title="Loved!">
								<input id="Field8_4" name="Field8" type="radio" value="Loved!" />
								<label for="Field8_4">4</label>
							</td>
						</tr>
					</tbody>
				</table>
			</li>

			<li class="form-section disabled">
				<div id="form-field-8" class="span_one_two">
					<label class="desc title" id="title104" for="Field104">
						Are you caught up on Game of Thrones?
					</label>
					<div>
						<select id="Field104" name="Field104" class="field select medium" tabindex="31" > 
							<option value="Never seen it" selected="selected">
								Never seen it
							</option>
							<option value="Yep, totally caught up" >
								Yep, totally caught up
							</option>
							<option value="I&#039;ve seen some but I&#039;m not caught up" >
								I've seen some but I'm not caught up
							</option>
						</select>
					</div>
				</div>

				<div id="form-field-9" class="span_two_two">
					<label class="desc title" id="title107" for="Field107">
						What is your favorite Fantasty or Sci-Fi movie of all time?
					</label>
					<div>
						<input id="Field107" name="Field107" type="text" class="field text medium" value="" maxlength="255" tabindex="32" onkeyup="" />
					</div>
				</div>
			</li>

			<li class="disabled">

				<div class="form">
					<section>
						<h3 id="title108"  class="title">
							Your Information
						</h3>
					</section>

					<div id="form-field-10">
						<label class="desc" id="title105" for="Field105">
							Name
						</label>
						<span>
							<input id="Field105" name="Field105" type="text" class="field text fn" value="" size="8" tabindex="33" />
							<label for="Field105" class="label-sub">First</label>
						</span>
						<span>
							<input id="Field106" name="Field106" type="text" class="field text ln" value="" size="14" tabindex="34" />
							<label for="Field106" class="label-sub">Last</label>
						</span>
					</div>

					<div id="form-field-11">
						<label class="desc" id="title110" for="Field110">
							Email
						</label>
						<div>
							<input id="Field110" name="Field110" type="email" spellcheck="false" class="field text medium" value="" maxlength="255" /> 
						</div>
					</div>

					<div id="form-field-12">
						<label class="desc" id="title117" for="Field117">
							Website
						</label>
						<div>
							<input id="Field117" name="Field117" type="url" class="field text medium" value="" maxlength="255" tabindex="36" /> 
						</div>
					</div>

					<input id="saveForm" name="saveForm" class="btTxt submit" type="submit" value="Submit"/>
				</div>
			</li>

			<a id="next-section" class="next-section">Next Section</a>
		</ul>
	</form>
              
            
!

CSS

              
                @import "compass/css3";

/* ---------- Functions ---------- */

@function emCalc($pxWidth) {
  @return $pxWidth / $em-base * 1em;
}

/* ---------- Web Fonts ---------- */

@import url(https://fonts.googleapis.com/css?family=Josefin+Slab:600,400|Source+Sans+Pro:300);

$font-family-serif: 'Josefin Slab', Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
$font-family-sans: 'Source Sans Pro', Tahoma, Verdana, Segoe, sans-serif;

$em-base: 16px;

/* ---------- Colors ---------- */

$white: #FFF;
$white-dark: #cecec8;
$cream: #f8f9f6; 

$grey: #3d3d3d;
$grey-lighten: adjust_hue(lighten(#3d3d3d, 24), 0);
$grey-darken: adjust_hue(darken($grey, 11), 0);

$blue: #48dce5;
$blue-darken: darken(#48dce5, 12);

/* ---------- Universal selectors ---------- */

* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }

/* ---------- Text Highlight ---------- */

::selection {
  background: $grey-lighten;
  color: $white;
}

::-moz-selection {
  background: $grey-lighten;
  color: $white;
}

/* ---------- Placeholders ---------- */

%title {
  display: block;
  padding: 0 0 emCalc(18px);
  width: 90%;
  color: $grey;

  text-transform: uppercase;
  letter-spacing: emCalc(1px);
  font-weight: 300;
  font-size: emCalc(20px);
  font-family: $font-family-sans;
}

/* ---------- Grid ---------- */

.span_one_two{
  float: left;
  width: 50%;
}
.span_two_two{
  @extend .span_one_two;
}

/* ---------- General Elements ---------- */

body {
  padding: emCalc(25px);
  color: $grey-lighten; 
  font-weight: 300;
  font-family: $font-family-sans;
}

h2 {
  margin: 0 0 emCalc(10px);
  color: $grey-darken;
  text-transform: uppercase;
  letter-spacing: emCalc(2px);
  font-weight: 600;
  font-size: emCalc(30px);
  font-family: $font-family-serif;
}

h3 {
  margin: 0;
}

/* ---------- Progress Bar ---------- */

.form-progress {
  padding: 0 emCalc(25px);
  background-color: $cream;
}

.progress {
  display: block;
  overflow: hidden;
  width: 100%;
  height: emCalc(40px);
  border-radius: (emCalc(10px));
  background-color: $grey;
  box-shadow: inset emCalc(1px) emCalc(4px) emCalc(9px) emCalc(3px) $grey-darken;
  transition: width .5s ease-in-out;
  
  span {
    float:left;
    width: 0;
    height: 100%;
    background-color: $blue;
    box-shadow: inset emCalc(1px) emCalc(4px) emCalc(9px) emCalc(3px) $blue-darken;
    transition: width .5s ease-in-out;
  }
}
/* ---------- Form Header ---------- */

.form-header {
  margin: 0;
  padding: emCalc(25px) emCalc(25px) emCalc(40px);
  background-color: $cream;
  text-align: center;
}

.quote {
  color: $grey-lighten;
  font-style: italic;

  span {
    display: block;
    width: 100%;
    font-style: normal;
  }
}

/* ---------- Form ---------- */

form {
  margin: 0 auto;
  padding: 0 0 emCalc(25px);
  max-width: 75%;
  border-radius: (emCalc(10px));
  transition: max-width .3s ease-out, background-color .25s ease-out;

  &:hover {
    transition: background-color .5s ease-in;
  }

  ul {
    position: relative;
    margin: 0;
    padding: 0 0 emCalc(25px);
  }

  li {
    position: relative;
    clear: both;

    width: 100%;
    background-color: $cream;
    list-style: none;

    -webkit-transition:all 1s ease-in-out;
    -moz-transition:all 1s ease-in-out;
    -o-transition:all 1s ease-in-out;
    transition:all 1s ease-in-out;
    -webkit-transform-origin: 50% 100%;
    -ms-transform-origin: 50% 100%;
    
    transform-origin: 50% 100%;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
  }
    
  .disabled{
    visibility: hidden;
    height: 0;
    -webkit-transform:rotateX(90deg);
    -moz-transform:rotateX(90deg);
    -o-transform:rotateX(90deg);
    transform:rotateX(90deg);
  }
  
  .enabled {
    padding: emCalc(30px);
    height: auto;
    -webkit-transform:rotateX(0deg);
    -moz-transform:rotateX(0deg);
    -o-transform:rotateX(0deg);
    transform:rotateX(0deg);
  }

  input {
    padding: emCalc(5px);
    border: emCalc(1px) solid $white-dark;
    border-radius: emCalc(5px);
    color: $grey-lighten;
    transition: border 1s ease-out,padding .25s ease-out; 
      
    &:focus {
      padding-right: emCalc(15px);
      border:1px solid $blue;
      transition: border .4s ease-in, padding .1s ease-in; 
    }
  }

  legend {
    @extend %title; 
  }

  fieldset {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
  }
  
  .submit {
    transition: background-color .25s ease-out, color .3s ease-out;
      text-transform: uppercase;
      font-size: emCalc(16px);
    
    &:hover {
      background-color: $grey-lighten;
      color: $white;
      transition: background-color .25s ease-in, color .3s ease-in;
    }
  }

  .form-section {
    float:left;
    margin: 0; 
    border-bottom: emCalc(4px) solid $white;
  }

  .form{
    margin: 0 auto;

    div {
      display: block;
      float:left;
      margin: 0 0 emCalc(15px);
      width: 100%;
    }

    input{
      width:100%;
    }

    label{
      display: block;
      width: 100%;
    }
    .label-sub {
      color: #bdbdbd;
    }

    span{
      float: left;
      width: 50%;
      input{
        width: 80%;
      }
    }
  }

}

/* ---------- Table ---------- */

table {
  width: 100%;
  border: emCalc(1px) solid $white-dark;

  td {
    padding: 0.25em;
    width: emCalc(130px);
    border-left: emCalc(1px) solid $white-dark;
    text-align: center;
  }

  tr {
    transition: background-color .5s ease-out;
    
    &:hover {
      background-color: #f3f3f3;
      transition: background-color .25s ease-in;
    }
  }

  th,
  td { 
    border-bottom: emCalc(1px) solid $white-dark;
    font-weight: 300;
  }

  caption {
    text-align: left;
  }

  tbody {
    td label {
      display: block;
    }
    
    th {
      padding: emCalc(8px);
      text-align: left;
    }
  }

  thead {
    
    td {
      padding: emCalc(10px) emCalc(6px);
    }
    
    td, th {
      background-color: $grey-lighten;
      color: $white;
      text-transform: uppercase;
    }
  }

}

/* ---------- Misc ---------- */

.choice {
  display: block;
  margin: emCalc(-20px) 0 0 emCalc(25px);
  padding: 0 0 emCalc(10px) 0;
  cursor: pointer;
}

.title {
  @extend %title;
  
  table & {
    display: table-caption;
  }
}

.next-section{
  display: block;
  margin: 0 auto;
  padding: emCalc(5px) 0;
  width: 25%;
  border-radius: emCalc(15px);
  background-color: $grey-lighten;
  color: $white;
  text-align: center;
  text-transform: uppercase;
  font-size: emCalc(20px);
  cursor: pointer;
  transition: .25s background-color ease-out;

  &:hover {
    background-color: $grey;
    transition: .4s background-color ease-in;
  }

}

/* ---------- Media Queries ---------- */

@media only screen and (max-width: 600px) {
  .span_one_two, 
  .span_two_two{
    margin: 0 0 emCalc(25px);
    width: 100%;
  }
}

@media only screen and (max-width: 1120px) { 
  form {
    max-width: 100%;
  }
}

              
            
!

JS

              
                $(document).ready(function() {
	var form_section_total = 0;
	var form_section_names = [];
	var next_section = $('#next-section');
	var total_sections = $('li').length -1;

	//Store all form field sections in an array
	$("[id^=form-field]").each(function() { 
		//Push id values to array with id #
		form_section_names.push('#' + $(this).attr('id'));
		//Calc the length of the array
		form_section_total = form_section_names.length;
	});
	
	next_section.on('click', function(e) {

		var currentEnabled = $('.enabled').last(); //Latest section to be enabled
		var totalEnabled = $('.enabled').length; //Number of enabled sections

		currentEnabled.next('.disabled').removeClass('disabled').addClass('enabled');
			
		//Hide Next buton if all sections are enabled
		if ( totalEnabled === total_sections ) {
			next_section.fadeOut();
		}

		//Update Progress bar
		progressBar(totalEnabled,total_sections);
		
	});

	function progressBar (enabled,totalSections) {
		var currentPercentage = enabled / totalSections * 100;

		$('#progress-width').css('width',currentPercentage + "%");
	}

});
              
            
!
999px

Console