Difference between revisions of "Including a file"

(Got tired of looking these up over and over)
 
(→‎CSS in HTML: clean up & uniformity)
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
==CSS in HTML==
 
==CSS in HTML==
  
−
<link rel="stylesheet" type="text/css" href="class.css" /><ref> [http://www.webstartcenter.com/howto/css_inc.php Ways to include CSS in your page]</ref>
+
<link rel="stylesheet" type="text/css" href="class.css" /><ref>[http://www.webstartcenter.com/howto/css_inc.php Ways to include CSS in your page]</ref>
  
−
==Javascript in HTML==
+
==[[Javascript]] in [[HTML]]==
  
 
<script src="myscript.js"></script>
 
<script src="myscript.js"></script>
Line 12: Line 12:
  
 
include 'NiceScript.php';<br />
 
include 'NiceScript.php';<br />
−
include 'anything.html'
+
include 'anything.html';
  
 
==Notes==
 
==Notes==
 
<references />
 
<references />
 +
[[Category:Computer tips]]

Latest revision as of 14:17, July 13, 2016

Including a file in source code is a very common practice, especially in web page design. However, there are so many ways to do this, that it can be hard for the beginner to keep track.

CSS in HTML

<link rel="stylesheet" type="text/css" href="class.css" />[1]

Javascript in HTML

<script src="myscript.js"></script>

PHP

include 'NiceScript.php';
include 'anything.html';

Notes