Can one CSS file take priority over another CSS file?

后端 未结 8 2180
日久生厌
日久生厌 2020-12-01 06:16

I\'m in London working on an application, and the html/css guy is in New York. He\'s sending me updates daily by email as we have no source control set up that we can both u

相关标签:
8条回答
  • 2020-12-01 06:44

    It depends on how you set them in your header. So something like this will work:

    <link rel="old stylesheet" href="path/to/style.css" />
    <link rel="newer stylesheet" href="path/to/style.css" />
    <link rel="newest stylesheet" href="path/to/style.css" />
    

    The last one will be picked up.

    And an helpful link about stylesheets here: http://www.w3.org/TR/html401/present/styles.html#h-14.3.2

    See also: Precedence in CSS if the above doesn't work for you.

    Hope it is clear.

    0 讨论(0)
  • 2020-12-01 06:45

    Css rules are sequential, you should do two things on your html files

    1. Include your CSS as the last css
    2. Add !important on all css attributes in your css file Eg: position : absolute !important;

    that should serve your purpose

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