Use a new CSS file to override current website's CSS

前端 未结 12 876
梦如初夏
梦如初夏 2020-11-30 10:04

My website has currently 3 CSS files that are automatically included as a part of the website and I do not have access to the source i.e. index.html

12条回答
  •  再見小時候
    2020-11-30 10:36

    In your new CSS file, add !important to the block of code, for instance:

    if you have this on css1.css:

     h2{
     color:#000;
     }
    

    In css4.css put the same element, but with !important, as follows;

     h2{
     color:#ccc !important;
     }
    

    Therefor, !important will force that this style will be by all means the style set for the element to which it's applied.

提交回复
热议问题