The bootstrap boot button and button do not have the same width. How to fix?

I added a width property for the boot buttons. However, he did not make <a class="btn" />the same width as <button class="btn" />. Here is jsFiddle .

This is in Chrome.

+5
source share
1 answer

Resetting left and right paddingto zero helps, but leaves the link 2px wider.

This is due to the fact that the user agent applies the chrome elements box-sizing: border-boxto button, which means that paddingwill be included in width, and not in addition to it.

Setting box-sizing: content-boxin your class also eliminates this 2px difference.

See the demo .

+9
source

All Articles