Page-specific css rules - where to put them?

后端 未结 11 2046
粉色の甜心
粉色の甜心 2021-02-05 05:52

Often when I\'m designing a site, I have a need for a specific style to apply to a specific element on a page and I\'m absolutely certain it will only ever apply to that element

11条回答
  •  一个人的身影
    2021-02-05 06:38

    Defining the style in the consuming page or inlineing your style are two sides of the same coin - in both cases you are using page bandwidth to get the style in there. I don't think one is necessarily better than the other.

    I would advocate making an #Selector for it in your site-wide main stylesheet. The pollution is minimal and if you really have that many truly unique cases, you may want to rethink they way you mark-up your sites.

提交回复
热议问题