Simple HTML tag - need some help

itgeek2524

New Member
Messages
6
Reaction score
0
Points
0
Hello, I am in need of some wuick help on one part of my coding. I want to know if there is a way to refernce a HTML file as a template for some codes that I can display on all pages by:
script type="text/HTML" src="file.html"
Is this possible or is there another tag i should be looking at?
Thanks
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
W3Schools is outdated, inaccurate and incomplete.

CSS won't help here. You need to use some form of includes, which HTML doesn't support. Thankfully, there are other web technologies (such as PHP and server-side includes) that do. The topic has already been covered many times on these forums (e.g. "How do I put include files in html - what is the syntax please"); forum and web searches will reveal all you need to know.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Style sheet

Well, somebody wasn't paying attention. As misson said, CSS won't handle this -- it's a job for dynamic scripting (eg, PHP) or server-side includes. CSS can alter the appearance of the document, and can include either plain text or images to be placed before or after existing elements, but it cannot (yet) render HTML to the page. JavaScript can add HTML, but that depends on JavaScript being enabled in the browser (and it's not just a matter of adding a tag to a page).
 
Last edited:

itgeek2524

New Member
Messages
6
Reaction score
0
Points
0
Thanks everyone. The answer was PHP. I was trying to do it with HTML and Javascript and didn't get anywhere. I wasn't even thinking about PHP (which isn't really my strong point). Doing
<?php
include ('doc.php');
?>

worked!
Thanks again
 
Top