Inline CSS/Javascript into a HTML file

后端 未结 4 1520
萌比男神i
萌比男神i 2021-02-02 01:07

I am looking for a simple commandline script/program to automatically \"inline\" all external css and javascript references for a html file. I basically want to create a single

4条回答
  •  天命终不由人
    2021-02-02 01:40

    There is a Node.js library which solves exactly your problem: https://github.com/remy/inliner/ It can be used both as a commandline script and a library.

    It will make you a single .html file which can be sent anywhere by any means and be opened later in any browser without the need in Internet connection.

    If you think about inlining CSS and Javascript to make a HTML body of an email, just forget about it. Most Email clients out there will either ignore or badly damage your styles and I think all email clients will just plainly drop the inline Javascript in the body of emails.

提交回复
热议问题