Hi! I want to put a html file into another html file . I tried iframe and object tag, which works but the problem is i also get scrolling frames. How can i insert a html file into another html file as it is without anything added to it like scrolling bars ?
Thx !

3 Years
Discussion Span
Last Post by samson.oba.77

The best way is server side using either php or asp.net or any other server side language.
If server side is not an option for you than sticking with your iframe you can hide bars like this in css:
<iframe src="/path/to/file.html" seamless></iframe>
iframe[seamless] {
border: none;}
Remember though that iframes have many, many disandvantages.
Another way can ve JavaScript. You can see some hints here:
and here:


You can do with two option, pure HTML or javascript/jquery:
for example, you have a file "footer.html" to be included in index.html

  1. in Javascript


inside <body> tag (or, where you want to include the file (footer.html)), place this:

<div id="include_html"></div>

Note: If you have more than 1 file included, just add new line below $("#include_html").load("footer.html"); with different Selector, as in;


Note that .load() requests files from the server.
An alternative would be to use SSI (server side includes):


<!--#include file="footer.html" -->

However the "containing page" should have the specific extensions .shtml, .stm or .shtm. That is sometimes a deal breaker for some. If you don't want to use php or asp or any other flavour of full-blown server side language, SSI could provide a simple fix without needing to include a js library. SSI will work even if the user has js turned off (rare but a possibility).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.