Skip to content Skip to sidebar Skip to footer

Include External Css/js File Into Html Page

I'm trying to link manually my CSS and Javascript files to my HTML scripts, but I've never really done it with files from a different folder/directory. This is what I have so far:

Solution 1:

If you want to add scripts from local path you can use a relative path:

<link rel="stylesheet"type="text/css" href="../CSS/tempeststyle.css"/>

or relative path from your web root folder:

<link rel="stylesheet"type="text/css" href="/styles/CSS/tempeststyle.css"/>

or filesystem absolute path:

<link rel="stylesheet"type="text/css" href="file:///C:/Path/To/Scripts/styles/CSS/tempeststyle.css"/>

It is rather better if you use an absolute path from your web server:

<link rel="stylesheet"type="text/css" href="http://www.example.com/styles/CSS/tempeststyle.css"/>

Post a Comment for "Include External Css/js File Into Html Page"