Is there any way keep part of my code in a seperate document? [closed]

I’m guessing the block of data you want to move to a separate file is also HTML code? If so, you can do this: Move that block of code into a separate .html file and insert this line into your page:

<object type="text/html" data="yourFile.html" style="height:300px; width:96%; margin:2%;"></object>        

The height, width, and margin should be like you actually want it. The values in there at the moment is just an example. The important part is the “data” attribute.

If you don’t want the external HTML code to display, you can set the visibility of the object to hide it.

Hope this is what you were looking for.

Leave a Comment