Link to home
Start Free TrialLog in
Avatar of ank5
ank5Flag for India

asked on

Bootstrap 3 - reduce the text and field size

I am creating a form in Bootstrap 3. Would like to have the input fields and label surrounding them to appear smaller than what bootstrap provides by default.

In order to do so, I have created a couple of css classes

.input-field {
  height: 20px
}

.label-size {
  font-size: 10px;
  line-height: 1.2;
}

Open in new window


however, this has messed up the alignment for checkboxes. The label for each checkbox does not appear properly aligned with the checkbox and also the label for the field (<label> tag) appears mis aligned.

Here is the fiddle - https://jsfiddle.net/yyky0ms1/1/

How can I correct this?
ASKER CERTIFIED SOLUTION
Avatar of error2013
error2013

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ank5

ASKER

Thank you very much. This does align the checkbox and it's label correctly. However, the label for all the checkboxes ('Effort' in the fiddle) is still not aligned correctly (it's towards the top of where checkboxes are).  What can I do to correct that?

Updated fiddle - https://jsfiddle.net/yyky0ms1/5/
Avatar of error2013
error2013

The best way to not brake other labels is to add a new class name to your effort one, for example:

 <label class="col-xs-4 label-size custom-label">Effort</label>

Open in new window


And this add some extra css for this new class:

.custom-label {
  line-height: 3.3em !important;
}

Open in new window


Hope this helps.