Question

How to load Javascript folder and CSS folders into my server?

Posted May 24, 2018 1.5k views
Nginx Apache DigitalOcean JavaScript Ubuntu 18.04

I’m trying to load Javascript and CSS folders into my server by copy pasting. When opening index.html the site does not pick up the JS and CSS mods. How can I make it work? Answers appreciated!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

You must create a link to the CSS and JS files in the head of your page. Below is an example of an internal link <link rel=“stylesheet” href=“main.css”>, and an external link <script src=“https://apis.google.com/js/platform.js” async></script>

<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>LINKS</title>
        <meta name="Below are 2 ways to link JS and CSS.">

        <link rel="stylesheet" href="main.css">
        <script src="https://apis.google.com/js/platform.js" async></script>

    </head>
    <body>
Submit an Answer