Is it possible to style a div (and its children) with another stylesheet?

I'm trying to show a print-preview div (`#preview` in examples). Is there a way to use `print.css` only for a particular div and its children overriding all local definitions? Essentially, I would like to be able to do something similar to: #preview element { definition equal to definition of an element in print.css } in main.css, but for a long list of definitions. It's not too DRY and following option is more coherent. Second approach would be to include `print.css` into the main document and change each definition from element { definition } to: element, #preview element { definition } But that seems to me a bit cumbersome. What would be the best way to solve this problem? **Update** just to give an example: in the main document I have red underlined links, they should be blue undecorated in print version. So when content of preview is dynamically formed, I pop up div where all links should be blue undecorated. But only in that particular div (`#preview`), in the rest of the document they still would be red and underlined.
I'm not sure I understand the question. Are you trying to do something like: ... all the main content ...
...some other content...
? Please offer a little more information.

以上就是Is it possible to style a div (and its children) with another stylesheet?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏