Ahmadali Shafiee
Ahmadali Shafiee

Reputation: 4657

Twitter Bootstrap button-group as text input add-on isn't so nice

This is what I've tried:

<div class="input-prepend input-append">
    <input type="text" />
        <div class="add-on btn-group" data-toggle="buttons-radio">
            <button type="button" class="btn btn-primary" dir="ltr">http://</button>
            <button type="button" class="btn btn-primary" dir="ltr">https://</button>
        </div>
</div>

but the group-button's padding and margin made it ugly! you can see it in jsFiddle

How can I fix it?

Upvotes: 1

Views: 3951

Answers (2)

Harry Knowles
Harry Knowles

Reputation: 3

Try changing your code to this:

<div class="input-prepend input-append">
<div class="btn-group" data-toggle="buttons-radio">
    <button type="button" class="btn btn-primary" dir="ltr">http://</button>
    <button type="button" class="btn btn-primary" dir="ltr">https://</button>
<input type="text" />
</div>

:)

Upvotes: 0

PiLHA
PiLHA

Reputation: 2374

Remove add-on from class="add-on btn-group"

Upvotes: 8

Related Questions