user3256408
user3256408

Reputation: 11

where and how to link html file,css file,javascript file and jsp

i have CSS file in one folder,html file in one folder,javascript in one folder. where shoul i link these files and how?whether in html or jsp page.please let me know.. even after giving a link like where CSS is my folder. how a proper aggregation is needed in in eclipse considering the industry standards ?

Upvotes: 1

Views: 3797

Answers (2)

Daniel
Daniel

Reputation: 379

use link element to link various resources to your page like: CSS files, a favorite icon ... check out this video demo

and script tag (as shown above by Crazysheep) to link scripts

Upvotes: 0

cbreezier
cbreezier

Reputation: 1304

You link the files on your html page in the head of the document.

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="../css/main.css">
        <script src="../js/main.js"></script>
    </head>
    ...

Some people recommend linking javascript at the end of the document (just before the closing body tag) so that the visible elements can be rendered first before the javascript is parsed.

Just to clarify, css must be in the head; javascript can be anywhere and possibly/probably optimal at the end.

Upvotes: 2

Related Questions