Resizing buttons in Twitter-Bootstrap

前端 未结 2 453
生来不讨喜
生来不讨喜 2021-02-01 14:51

I\'m developing a mobile-friendly web app which I would like to feature a dead-simple UI, including buttons so large even Andre the Giant could tap them with ease.

The

相关标签:
2条回答
  • 2021-02-01 15:09

    @amustill's answer is easily adapted for Bootstrap 3.1.0:

    .btn-xl {
        padding: 18px 28px;
        font-size: 22px;
        border-radius: 8px;
    }
    

    jsFiddle: http://jsfiddle.net/Abdull/2rkkJ/

    With this adaption automatically come :hover darkening and :active shadow insetting.

    0 讨论(0)
  • 2021-02-01 15:25

    Bootstrap is a great framework, but it doesn't cover everything. It knows that and using its OOCSS principle should be extended to your needs.

    If I'm adapting Bootstrap components themselves, I generally create a bootstrap-extensions.css file which houses any extensions of base components, such as an extra large button.

    Here's an example implementation of how one extension class adds a new family of buttons to the framework. This example also includes an example use of .btn-block, which is already included in the framework.

    CSS:

    /**
     * Extra large button extensions. Extends `.btn`.
     */
    .btn-xlarge {
        padding: 18px 28px;
        font-size: 22px;
        line-height: normal;
        -webkit-border-radius: 8px;
           -moz-border-radius: 8px;
                border-radius: 8px;
        }
    

    Demo: http://jsfiddle.net/Pspb9/

    0 讨论(0)
提交回复
热议问题