How can I override Bootstrap CSS styles?

前端 未结 12 1028
囚心锁ツ
囚心锁ツ 2020-11-22 05:35

I need to modify bootstrap.css to fit my website. I feel it\'s better to create a separate custom.css file instead of modifying bootstrap.css

12条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 06:15

    To reset the styles defined for legend in bootstrap, you can do following in your css file:

    legend {
      all: unset;
    }
    

    Ref: https://css-tricks.com/almanac/properties/a/all/

    The all property in CSS resets all of the selected element's properties, except the direction and unicode-bidi properties that control text direction.

    Possible values are: initial, inherit & unset.

    Side note: clear property is used in relation with float (https://css-tricks.com/almanac/properties/c/clear/)

提交回复
热议问题