style and script tags in HTML body… why not?

后端 未结 7 2041
野的像风
野的像风 2020-11-29 06:57

[This is related to this question, but not since it\'s not about email.]

In many cases -- especially when working with a CMS or someone else\'s fram

7条回答
  •  一个人的身影
    2020-11-29 07:31

    Two possible answers for style in the body:

    1. Use inline styling. True, you'll lose the advantages of internal and external styling, but if you don't have access to the header, then you don't have access to the header.

    2. Use the scoped attribute in the style element. This is new to HTML5, but the idea is to limit the scope of the CSS to a part of a page, for example to a single div. The bad news is that it is not yet supported (as of July 2011), nor is it backwards compatible. But there is (allegedly) a JQuery plugin that can help. For more info:

      • http://thingsinjars.com/post/359/css-scoped/
      • http://thingsinjars.com/post/360/scoped-style/

提交回复
热议问题