1

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 ?

1
  • Are you referring to linking files on a web server or from your personal machine? Commented Feb 7, 2014 at 8:18

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.