Page-specific css rules - where to put them?

后端 未结 11 1920
粉色の甜心
粉色の甜心 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:40

    I think you should definitely expand the thought process to include some doubt for "page specific css". This should be a very very rare thing to have. I'd say go for the global style sheets anyway, but refactor your css / html in a way that pages don't have to have super-specific styling. And if in the end there's a few lines of page-specific markup in the global css, who cares. It's better to have it in a consistent place anyway.

提交回复
热议问题