Styling twitter bootstrap buttons

前端 未结 14 2688
庸人自扰
庸人自扰 2020-12-04 05:18

Twitter-Bootstrap buttons are awesomely beautiful. Try them out by scrolling over them

\"bootstrap

相关标签:
14条回答
  • 2020-12-04 05:58

    In Twitter Bootstrap bootstrap 3.0.0, Twitter button is flat. You can customize it from http://getbootstrap.com/customize. Button color, border radious etc.

    Also you can find the HTML code and others functionality http://twitterbootstrap.org/bootstrap-css-buttons.

    Bootstrap 2.3.2 button is gradient but 3.0.0 ( new release ) flat and looks more cool.

    and also you can find to customize the entire bootstrap looks and style form this resources: http://twitterbootstrap.org/top-5-customizing-bootstrap-resources/

    0 讨论(0)
  • 2020-12-04 05:59

    Instead of changing CSS values one by one I would suggest to use LESS. Bootstrap has LESS version on Github: https://github.com/twbs/bootstrap

    LESS allows you to define variables to change colors which makes it so much more convenient. Define color once and LESS compiles CSS file that changes the values globally. Saves time and effort.

    0 讨论(0)
  • 2020-12-04 06:00

    For Bootstrap for Sass override it's

    .btn-default {
    
        @include button-variant($color, $background, $border);
    
    }
    

    You can see the source for it here: https://github.com/twbs/bootstrap-sass/blob/a5f5954268779ce0faf7607b3c35191a8d0fdfe6/assets/stylesheets/bootstrap/mixins/_buttons.scss#L6

    0 讨论(0)
  • 2020-12-04 06:03

    If you are already loading your own custom CSS file after loading bootstrap.css (version 3) you can add these 2 CSS styles to your custom.css and they will override the bootstrap defaults for the default button style.

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary {
    
      background-color: #A6A8C1;
      border-color: #31347B;
     }
    
    .btn
    {
      background-color: #9F418F;
      border-color: #9F418F;
    }
    
    0 讨论(0)
  • 2020-12-04 06:04

    Here is a good resource: http://charliepark.org/bootstrap_buttons/

    You can change color and see the effect in action.

    0 讨论(0)
  • 2020-12-04 06:04

    In order to completely override the bootstrap button styles, you need to override a list of properties. See the below example.

        .btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary.focus, 
        .btn-primary:active, .btn-primary.active, .btn-primary:visited,
        .btn-primary:active:hover, .btn-primary.active:hover{
            background-color: #F19425;
            color:#fff;
            border: none;
            outline: none;
        }
    

    If you don't use all the listed styles then you will see the default styles at performing actions on button. For example once you click the button and remove mouse pointer from button, you will see the default color visible. Or keep the button pressed you will see default colors. So, I have listed all the pseudo-styles that are to be overridden.

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