0
我有HTML文件和外部CSS文件,喜欢将外部样式表中的样式内嵌到头顶部的一个内嵌<style>
标签。在此先感谢您的帮助将css文件转换为HTML格式的内联样式使用npm包
注意:不要使用样式属性应用到每一个元素,希望有在顶部
一个风格标签转换
p {
color: red; }
<!DOCTYPE html>
<html lang="en">
<head>
\t <meta charset="utf-8">
\t <title>HTML Template</title>
\t <link rel="stylesheet" type="text/css" href="css/mystyle.css">
\t <script type="text/javascript" src="js/myscript.js"></script>
</head>
<body>
\t <p>Welcome to Template!!</p>
</body>
</html>
转换后
<!DOCTYPE html>
<html lang="en">
<head>
\t <meta charset="utf-8">
\t <title>HTML Template</title>
<!-- START: Replaced inline tag from external css file mystyle.css as above-->
\t <style>
.p{color:red}
</style>
<!-- END: Replaced inline tag from external css file mystyle.css as above-->
\t <script type="text/javascript" src="js/myscript.js"></script>
</head>
<body>
\t <p>Welcome to Template!!</p>
</body>
</html>