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.

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" ng-app="myApp" ng-controller="demoController">
  <div class="col">
    <div class="row">
      <div class="col">
        <h1>Form controls</h1>
        <p>Inputs and labels are show with <code>.ha-form-lg</code>, default size, and <code>.ha-form-sm</code> from left to right.</p>
      </div>
    </div>

    <form name="TestForm" autocomplete="off" novalidate>

      <div class="row">
        <div class="col">
          <h3>Input</h3>
          <p>Labels need the <code>.ha-label</code> class. Eyebrow is the default style. Add size classes on the label and the input/select will inherit them. No classes are needed on the nested input/select.</p>
        </div>
      </div>
      <div class="row">
        <div class="col-4">
          <label class="ha-label ha-form-lg required-asterisk">
            <span>Address<span class="required">*</span></span>
            <input type="text" name="Address" ng-model="model.Address" placeholder="Enter an address" ng-pattern="$root.$regex.addressLine" required />
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label">
            <span>Address</span>
            <input type="text" name="Address2" ng-model="model.Address" placeholder="Enter an address" />
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label ha-form-sm">
            <span>Address</span>
            <input type="text" name="Address3" ng-model="model.Address" placeholder="Enter an address" />
          </label>
        </div>
      </div>

      <div class="row">
        <div class="col">
          <p>Labels shown with <code>.inline</code> class</p>
        </div>
      </div>
      <div class="row">
        <div class="col-4">
          <label class="ha-label inline ha-form-lg required-asterisk">
            <span>Email<span class="required">*</span></span>
            <input type="text" name="Email" ng-model="model.Email" placeholder="Enter an email" ng-pattern="$root.$regex.email" required />
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label inline">
            <span>Email</span>
            <input type="text" name="Email2" ng-model="model.Email" placeholder="Enter an email" disabled />
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label inline ha-form-sm">
            <span>Email</span>
            <input type="text" name="Email3" ng-model="model.Email" placeholder="Enter an email" />
          </label>
        </div>
      </div>

      <div class="row">
        <div class="col">
          <h3>Select</h3>
          <p>Selects don't need any classes.</p>
        </div>
      </div>
      <div class="row">
        <div class="col-4">
          <label class="ha-label ha-form-lg">
            <span>Activity</span>
            <select name="Activity" ng-model="model.activity" required ng-options="i for i in activities">
              <option value="">Select</option>
            </select>
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label">
            <span>Activity</span>
            <select name="Activity2" ng-model="model.activity" ng-options="i for i in activities">
              <option value="">Select</option>
            </select>
          </label>
        </div>
        <div class="col-4">
          <label class="ha-label ha-form-sm">
            <span>Activity</span>
            <select name="Activity3" ng-model="model.activity" ng-options="i for i in activities">
              <option value="">Select</option>
            </select>
          </label>
        </div>
      </div>

      <div class="row">
        <div class="col">
          <p>Labels shown with <code>.inline</code> class</p>
        </div>
      </div>
      <div class="row">
        <div class="col-4">
          <label class="ha-label inline ha-form-lg">
            <span>Snack</span								>
            <select name="Snack" ng-model="model.snack" ng-options="i for i in snacks" required>
              <option value="">Select</option>
								 </select>
							 </label>
						</div>
						<div class="col-4">
							<label class="ha-label inline">
								<span>Snack</span								><select name="Snack2" ng-model="model.snack" ng-options="i for i in snacks" disabled>
									<option value="">Select</option>
								</select>
							</label>
						</div>
						<div class="col-4">
							<label class="ha-label inline ha-form-sm">
								<span>Snack</span								><select name="Snack3" ng-model="model.snack" ng-options="i for i in snacks">
									<option value="">Select</option>
								</select>
							</label>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<h3>Checkboxes</h3>
						</div>
					</div>
					<div class="row">
						<div class="col-6">
							<fieldset class="ha-check-or-radio-set">
								<legend class="screen-reader-only">Musical tastes</legend>
								<ul>
									<li>
										<input type="checkbox" id="Reggae" name="Reggae" value="Reggae" tabindex="0" checked="">
										<label for="Reggae">Reggae</label>
									</li>
									<li>
										<input type="checkbox" id="Electronic" name="Electronic" value="Electronic" tabindex="0">
										<label for="Electronic">Electronic</label>
									</li>
									<li>
										<input type="checkbox" id="SoulRevival" name="SoulRevival" value="SoulRevival" tabindex="0">
										<label for="SoulRevival">Soul Revival</label>
									</li>
									<li>
										<input type="checkbox" id="NeuroFunk" name="NeuroFunk" value="NeuroFunk" tabindex="0" disabled="">
										<label for="NeuroFunk">Neuro-funk</label>
									</li>
								</ul>
							</fieldset>
						</div>
						<div class="col-6">
							<fieldset class="ha-check-or-radio-set">
								<input type="checkbox" id="Terms" name="Terms" value="Terms" tabindex="0" ng-required="true">
                <label for="Terms">I agree to the Terms and Conditions.<span class="required">*</span></label>
							</fieldset>
						</div>
					</div>


					<div class="row">
						<div class="col">
							<h3>Radios</h3>
						</div>
					</div>
					<div class="row">
						<div class="col-6">
							<fieldset class="ha-check-or-radio-set">
								<legend class="screen-reader-only">Cabin type</legend>
								<ul>
									<li>
										<input type="radio" id="SuperSaverFirst" name="CabinType" value="SuperSaverFirst" tabindex="0" checked="">
										<label for="SuperSaverFirst">Super Saver First</label>
									</li>
									<li>
										<input type="radio" id="ExtraComfort" name="CabinType" value="ExtraComfort" tabindex="0">
										<label for="ExtraComfort">Extra Comfort</label>
									</li>
									<li>
										<input type="radio" id="Coach" name="CabinType" value="Coach" tabindex="0">
										<label for="Coach">Coach</label>
									</li>
								</ul>
							</fieldset>
						</div>
						<div class="col-6">
							<fieldset class="ha-check-or-radio-set">
                <legend class="screen-reader-only">Gender<span class="required">*</span></legend>
								<ul>
									<li>
										<input type="radio" id="Male" name="Gender" value="Male" tabindex="0" required>
										<label for="Male">Male</label>
									</li>
									<li>
										<input type="radio" id="Female" name="Gender" value="Female" tabindex="0" required>
										<label for="Female">Female</label>
									</li>
								</ul>
							</fieldset>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<br>
							<button type="submit" class="btn-primary" >Submit</button>
						</div>
					</div>

				</form>

			</div>
</div>
              
            
!

CSS

              
                @mauve: #B83292;
@darkViolet: #4D2E91;
@white: #fff;
@gray95: #FAFAF7;
@gray90: #F5F5F2;
@colorLinework: #E0E0DB;
@gray70: #D0D0D0;
@gray50: #6F6F6F;
@colorBodyTextLight: @gray50;
@alertColor: #CC0000;
@lgSize: 54px;
@normalSize: 46px;
@smSize: 32px;

/*///////////////////////////////////////
	LABEL
///////////////////////////////////////*/

.ha-label { 

	> span {
		// default style is eyebrow
		font-size: 0.8125em;
		margin: 0 0 8px;
		line-height: 1;
		padding: 0;
		display: block;
	}
  
	span.required {
		color:@alertColor;
		font-size: 130%;
   		line-height: .2em;
		margin-left:2px;
	}
	&.inline {

		> span {
			float:left;
			height:@normalSize;
			width:22%;
			margin:0;
			display:inline-block;
			text-align: center;
			line-height: @normalSize;
			font-style: italic;
			background: @gray90;
			border: 1px solid @colorLinework;
			border-right-width:0;
			color: @gray50;
			box-sizing:border-box;
			border-radius:4px 0 0 4px;
		}
		&.ha-form-lg > span {
			height:@lgSize;
			line-height:@lgSize;
		}
		&.ha-form-sm > span {
			height:@smSize;
			line-height:@smSize;
		}
		input[type=text], select {
			width:78%;
			border-radius: 0 4px 4px 0;
		}

	}
	// sizes
	&.ha-form-lg input[type=text],
	&.ha-form-lg select {
		height:@lgSize;
	}
	&.ha-form-sm input[type=text],
	&.ha-form-sm select {
		height:@smSize;
		padding-left:10px;
	}
}

/*///////////////////////////////////////
	ERROR
///////////////////////////////////////*/

.ha-label em { 
	.bodycopy-sans-4; /* extend => mixin */
	display:none;
	margin:5px 0 5px 10px;
	padding-top: 0;
	clear: both;
	line-height: 1.2em;
	float: left;
	color: @alertColor;
	font-style: italic;
	position:relative;
	&:before {
  		position: absolute;
  		left: -11px;
  		top: -2px;
  		font-style: normal;
  		font-size: 18px;
		content: "\25b8";
	}
	&.show {
		display:block;
	}
}
/*///////////////////////////////////////
	FOCUS
///////////////////////////////////////*/

select:focus,
input:focus,
button:focus {
	box-shadow: 0 0 0 2px @darkViolet;
}

/*///////////////////////////////////////
	INPUT
///////////////////////////////////////*/

.ha-label input[type=text] {
  .bodycopy-sans-4();
	width:100%;
	height:@normalSize;
	max-width:100%;
	padding: 0 10px 0 16px;
	display:inline-block;
	border: 1px solid @colorLinework;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border-radius:4px;
	outline:none;
	// error - invalid
	&.ng-dirty.ng-invalid {
		border:2px solid @alertColor;
	}
	// disabled
	&:disabled {
		color:@colorBodyTextLight;
		background-color:@gray95;
		cursor:not-allowed;
		border: 1px solid @colorLinework !important;
	}
}

// IE8 specific 
.lte-ie8 .ha-label {
	input[type=text] {
		padding-top:9px;
	}
	&.ha-form-lg input[type=text] {
		padding-top:12px;
	}
	&.ha-form-sm input[type=text] {
		padding-top:2px;
	}
}

// error - required
form.submitted input.ha-text-input.ng-invalid-required {
	border:2px solid @alertColor;
}

// focus
select:focus,
input:focus,
button:focus {
	box-shadow: 0 0 0 2px @darkViolet;
}


/*///////////////////////////////////////
	SELECT
///////////////////////////////////////*/

.ha-label select {
  .bodycopy-sans-4();
	width:100%;
	height:@normalSize;
	max-width:100%;
	padding: 0 40px 0 16px;
	display:inline-block;
	border: 1px solid @colorLinework;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background:@white url('http://imgh.us/down-arrow.svg') right 15px center no-repeat;
	text-overflow: ellipsis;
	white-space: nowrap;
	border-radius:4px;
	outline:none;
	// states	
	&:disabled {
		color:@colorBodyTextLight;
		background-image:url('http://imgh.us/down-arrow-disabled.svg');
		background-color:@gray95;
		cursor:not-allowed;
		border: 1px solid @colorLinework !important;
	}
	// ie 10+
	&::-ms-expand {
		display: none;
	}
}

// error
form.submitted select.ng-invalid-required {
	border:2px solid @alertColor;
}

.lte-ie9 .ha-label select {
	background-image:none;
	padding:10px 11px 10px 16px;
	&.ha-form-sm {
		padding:5px 10px 5px 10px;
	}
}

option { 
	border:0; // does nothing
	&:hover, &[selected] { // works only in IE11+
		background-color:@darkViolet;
		color:@white;
	}
}

/*///////////////////////////////////////
	CHECKBOXES/RADIOS
///////////////////////////////////////*/

@checkAndRadioHeight: 1.4em;

fieldset.ha-check-or-radio-set {
	padding:0;
	border:0;
	position: relative;
    span.required {
			color:@alertColor;
			font-size: 130%;
	   		line-height: .2em;
			margin-left:2px;
		}
	legend {
		font-size: 0.8125em;
		margin: 0 0 24px;
		line-height: 1;
		padding: 0;
	}
	ul {
		list-style-type: none;
		padding:0;
		margin:0;
	}
	label {
		display:block;
		margin-bottom:.9em;
		line-height: @checkAndRadioHeight;
		cursor:pointer;
	}
	input {
		position: absolute;
    	left: -9999em;
    }
	input + label::before {
		background:@white;
		border:2px @white solid;
    	box-shadow: 0 0 0 1px @darkViolet;
    	content: '\a0';
   		display: inline-block;
    	height: @checkAndRadioHeight;
    	width: @checkAndRadioHeight;
    	line-height: 1;
   		margin-right: 10px;
    	text-indent: .15em;
   		vertical-align: .15em;
	}
	input[type=checkbox] + label::before {
    	border-radius: 4px;
    }
	input[type=radio] + label::before {
    	border-radius: 50%;
    }
	// checked
	input:checked + label::before {
		background-color: @mauve;
    	//box-shadow: 0 0 0 1px @darkViolet;
	}
	input[type=checkbox]:checked + label::before {
		background-image: url('http://imgh.us/checkmark-white.svg');
		background-position: 50%;
		background-repeat: no-repeat;
	}
	// states
	input:focus + label::before {
	    box-shadow: 0 0 0 3px @darkViolet;
	}
	input:disabled + label::before {
		background:@gray90;
		box-shadow:0 0 0 1px @colorLinework;
	}
}

.lte-ie8 fieldset.ha-check-or-radio-set {
	label {
		line-height: 1em;
	}
	input[type=checkbox],
	input[type=radio] {
		float:left;
		position: static;
		margin-right:10px;
		border:0;
		width:auto;
	}
}

/*///////////////////////////////////////
	BUTTON 
///////////////////////////////////////*/

button {
  background:@mauve;
  color:white;
  border-radius:6px;
  .bodycopy-sans-4();
  font-weight:bold;
  padding:10px 12px;
  min-width:100px;
  outline:none;
  .animate();
  cursor:pointer;
  &:hover {
    background:@darkViolet;
  }
}

button.btn-primary {
	border:1px @white solid;
}

/*////////////////////////////////
    BASE STYLES
////////////////////////////////*/


body {
  font-family: helvetica-neue, 'HelveticaNeueLT Std', HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size:1em;
  line-height: 1.65;
  color: #333333;
  background:#ccc;
}

* { 
  box-sizing:border-box;
}

.container {
  background:#fff;
	min-height:100%;
	height:auto !important;
	height:100%;
  margin: 0 auto;
  max-width: 1100px;
  padding:10px 40px 40px;
  .clearfix();
}
form {
  padding:0;
  margin:0;
}
.row {
  margin:0 auto;
  width:100%;
  max-width: 1100px;
  .clearfix();
}
.col,
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11 { 
  float: left;
  padding:10px 15px;
  box-sizing:border-box;
  overflow:hidden;
}

.col-1  { width: 8.333333333333333%; }
.col-2  { width: 16.666666666666666%; }
.col-3  { width: 25%; }
.col-4  { width: 33.33333333333333%; }
.col-5  { width: 41.66666666666666%; }
.col-6  { width: 50%; }
.col-7  { width: 58.333333333333333%; }
.col-8  { width: 66.66666666666666%; }
.col-9  { width: 75%; }
.col-10 { width: 83.33333333333333%; }
.col-11 { width: 91.66666666666666%; }
.col-12, .col, .input--fill { width: 100%; }

.bodycopy-sans-4 {  
  font-style: normal;
  font-size: 1em;
  font-family: "helvetica-neue", "HelveticaNeueLT Std", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  text-transform: none;
  line-height: 1.6;
  letter-spacing: 0em;
}

.animate {
    transition: all .3s;
}

code {
  color:@darkViolet;
  font-size:1.3em;
}

.clearfix {
	&:after {
		content: " ";
		display: block; 
		height: 0; 
		clear: both;
	}
}
              
            
!

JS

              
                var app = angular.module('myApp', []);

app.controller('demoController', ['$scope',
  function($scope) {
    $scope.snacks = [
      'Spam musubi',
      'Acai bowl',
      'Ahi Poke',
      'Another option that takes up a lot of space'
    ];
    $scope.activities = [
      'Surfing',
      'Stand-up paddleboarding',
      'Canoeing',
      'Sailing',
      'Fishing',
      'Hiking',
    ];
    $scope.model = {};
  }
]);
              
            
!
999px

Console