How to override bootstrap style

前端 未结 3 1104
一生所求
一生所求 2021-01-22 04:33

I created the carousel and I need to override styles Indicators buttons. I have style:

.carousel-indicators {
    position: absolute; 
    bottom: 10px;
    left         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-22 05:17

    You should also keep an eye in which order your scripts are loaded to get everything working correctly. If you overwrite CSS, the overrided code should be loaded at last. Also interesting is to make use of important:

    .exampleClass {
        margin: 0 !important;
    }
    .exampleClass {
        margin: 5px;
    }
    

    The first one will overwrite the second one so that .exampleClass will have a margin of 0 because with !important you can tell the browsers that this directive has a higher weight than the others. But keep in mind that CSS will use the logical loading order of the code when you've multiplice important-statements because in this case the browser can't know which of them is more important than the other one.

提交回复
热议问题