Replace css and js links with the content of those files? [closed]

1

I am using a platform on which I can create my own sites, but not only can I write HTML, I have nowhere to put CSS or JS files.

I would like to know if there is a plugin or any tool that I can use so that instead of having the links to the css files and the js files, they are "embedded" directly in the html.

Ex:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <h1>Soy un titulo</h1>
    <p>soy un parrafo</p>
</body>
</html>

Be this:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<style>
		body, html{
			background: pink;
		}
	</style>
</head>
<body>
	<h1>Soy un titulo</h1>
	<p>soy un parrafo</p>
</body>
</html>

This, assuming that only the rule

is found in the style.css file
body, html{
            background: pink;
        }

In the case of the images if they can be had on the server, the only thing I have problems with is the CSS and JS.

    
asked by Gino Marín León 02.08.2017 в 01:20
source

1 answer

0

use php and do the following, if it is style, include the file inside the html style tag, and if it is a script in the html script tag

<style>
<?php echo file_get_contents('css/style.css');
</style>
    
answered by 02.08.2017 в 03:10