実際に外部CSSファイルを使用せずにCSSスタイルでHTML文書全体を取得する必要があります。外部CSSスタイルシートをインラインスタイルに変換するか、または<style>タグにJavaScriptを使用して変換します。
たとえば、私はこれを必要とする...
index.htmlを
<head>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="foo">Test</div>
</body>
CSS/Styles.cssを
#foo {
color: red;
}
...変換されました何かにFFのいずれかのような、そのよう:
1)外部CSS内のすべてのスタイルが
index.htmlを
<head>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="foo" style="color:red;">Test</div>
</body>
OR
要素にインラインDであります2)スタイルはインライン-dで<style>
タグ
index.htmlを
<head>
<link rel="stylesheet" href="css/styles.css">
<style>#foo { color: red; }</style>
</head>
<body>
<div id="foo">Test</div>
</body>
バニラJavascriptを/ jQueryの中でそのなんとかですか?ありがとう。
おそらくはい、なぜですか? – Roberrrt
このツールを使用すると、スタイルをインライン化できます。https://putsmail.com/tests/new –
はい...あなたは何をしましたか?参考までに、https://gist.github.com/surjikal/3007123の 'jquery.getStyleObject.js'プラグインを使用することができます –