what is the max number css rules I can specify in style sheet per browser

后端 未结 2 2023
一生所求
一生所求 2021-01-04 06:45

what is the max number css rules I can specify in style sheet per browser.

相关标签:
2条回答
  • 2021-01-04 07:22

    Internet Explorer 6-9 have a few reported limits:

    • Any rules after the first 4,095 are ignored
    • Any stylesheets included via @import, <link> or <style>, are ignored after the first 31
    • @import statements nested 4 or more levels deep are ignored

    These limits are outlined in KB 262161. In IE10 these limits were significantly raised to:

    • A stylesheet may contain up to 65,534 rules
    • A document may use up to 4,095 stylesheets
    • @import nesting no longer has its own limit

    There are no such reported limits for other browsers, but in theory any of them could run into performance issues with a large number of unoptimised CSS rules.

    Various sources:

    http://simple.procoding.net/2009/02/20/internet-explorer-limits-number-of-external-css-files-to-32/
    http://joshua.perina.com/africa/gambia/fajara/post/internet-explorer-css-file-size-limit
    http://am-blog.no-ip.org/BlogEngine/post/2010/03/24/CSS-File-Size-Limit-in-Internet-Explorer-6-7-8.aspx

    0 讨论(0)
  • 2021-01-04 07:31

    Are you talking about how many css includes you can do? IE does have a maximum of 32 (source) or maybe 31.

    However it sounds like you are asking if there is a maximum amount of styles you can include in a single .css file, and I am not aware of any limit in that respect.

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