Systematically resolve conflicting styles in css

后端 未结 4 1092
长情又很酷
长情又很酷 2021-02-20 04:31

I have some stylesheets from different sources in my web project. I want to harmonize them. Some styles I need from the one, some from the other. Is there a tool or method how

4条回答
  •  隐瞒了意图╮
    2021-02-20 04:57

    CSS doesn't have conflicts, it has cascades. The idea is that you CAN define multiple rules that apply to the same elements and the order in which you place the styles reflects an importance - i.e. if it appears last, it will override previous rules where there is something you describe as a conflict.

    You should either...

    1) Decide which style sheet is the most important and put it second

    OR

    2) Re-write your styles to avoid the mess

    OR

    3) Mark important rules as !IMPORTANT

提交回复
热议问题