Wonderfully Responsive Flexbox Form

A Pen By cimmanon

Pen Settings

↑ Insert the most common viewport meta tag

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.


              <div id="calculator">
	<section id="bal_attacker" class="fieldCol">

			<label for="bal_BS1">BS:</label> <br>
			<button type="button" id="bal_BS1inc" class="incbut"> + </button> 
			<input type="number" id="bal_BS1" value="1" class="inputField"> 
			<button type="button" id="bal_BS1dec" class="decbut"> - </button>

			<label for="bal_S">S:</label> <br>
			<button type="button" id="bal_Sinc" class="incbut"> + </button> 
			<input type="number" id="bal_S" value="1" class="inputField"/>
			<button type="button" id="bal_Sdec" class="decbut"> - </button>

	<section id="bal_defender" class="fieldCol" >

			<label for="bal_T">T:</label> <br>
			<button type="button" id="bal_Tinc" class="incbut"> + </button> 
			<input type="number" id="bal_T" value="1" class="inputField"> 
			<button type="button" id="bal_Tdec" class="decbut"> - </button>

	<section title="bal_Modifiers" class="modifiers">

			<li><label><input type="checkbox" id="bal_harmConv" class="regular-checkbox" /> Harm. Conv.</label></li>
			<li><label><input type="checkbox" id="bal_rrToHit" class="regular-checkbox" /> R.r. to hit</label></li>
			<li><label><input type="checkbox" id="bal_rrToW" class="regular-checkbox" /> R.r. to wound</label></li>


              #calculator, section.modifiers ul {
  display: -webkit-flexbox;
  display: -ms-flexbox;
  display: -webkit-flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
@supports (flex-wrap: wrap) {
  #calculator, section.modifiers ul {
    display: flex;

#calculator section {
  vertical-align: text-top;
  display: inline-block;
  width: 30%;
  min-width: 15em;
  -webkit-flex: 1 1 30%;
  -ms-flex: 1 1 30%;
  flex: 1 1 30%;

section.modifiers ul {
  padding: 0;

section.modifiers li {
  display: inline-block;
  list-style-type: none;
  -webkit-flex: 1 0 33%;
  -ms-flex: 1 0 33%;
  flex: 1 0 33%;
  white-space: pre;

/* pretty it up! */
#calculator section {
  background: #CCC;
  margin: .5em;
  padding: 1em;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  min-width: 10em;

#bal_attacker, #bal_defender {
  text-align: center;

#calculator h2 {
  text-align: center;
  margin-top: 0;

#calculator input[type="number"] {
  width: 3em;



Loading ..................