Gaboik1 Gaboik1 - 2 years ago 83
CSS Question

Bootstrap btn-xs does not have the same disabled style as btn

On an application I am building, I needed to disable a button by default.
The button I want to disable by default is the btn-danger

I need the

to be disabled by default and I need it to be a
so it doesn't make the
take too much space. As per the bootstrap documentation, for a button that is not an
tag, I added the boolean attribute
to the
element but I could not get the desired style.

I then realized that a
does not have the same style when it is disabled as a "normal"
has. here is a JSFiddle illustrating it.

Is this behavior intended and normal? Do I need to write a css button myself? What can I do to solve this? Thanks in advance!

Answer Source

You need to include the btn class as well. So the total class list is btn btn-xs btn-primary.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download