0

I´m trying to remove the last margin, for the text, on the "input-addon" for Bootstrap.

I´ve borrowed a fiddle:
http://jsfiddle.net/Dzhz4/250/

HTML

<div class="input-group">
  <div class="input-group-addon">Lit:</div>
    <input type="text" style="width: 40px" class="form-control input-sm"/>';
</div>';

CSS

.input-group-addon {
  max-width:30px;
  text-align:left !important;
}

EDIT
I´ve learned, i need padding. Not Margin.

m4n0
  • 25,434
  • 12
  • 57
  • 77
Björn C
  • 3,094
  • 6
  • 33
  • 71

1 Answers1

1

This is padding not margin.

.input-group-addon {
  min-width: 300px;
  text-align: left;
  padding-left: 0;
}

http://jsfiddle.net/Dzhz4/252/

Using something like Chrome Dev Tools is invaluable for finding stuff like this. I recommend learning how to use the element inspector as a starting point.

Antiga
  • 2,202
  • 1
  • 16
  • 27
  • Perfect. Thank you! I need to reed up on margin and padding! – Björn C Dec 07 '15 at 15:31
  • 1
    Here's a great SO answer to help you there: http://stackoverflow.com/questions/2189452/when-to-use-margin-vs-padding-in-css. Please remember to mark as Answer if it helped you. Cheers! – Antiga Dec 07 '15 at 15:32