Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of include() in HTML

I was wondering wether there is a way to include some html content inside another html using only html?

A replacement to PHP's

<?php include("file.php"); ?> 

Is this possible?

EDIT:

This has brought up some confusion, what I needed was "almost an html tag" that had the functionality of including a html document in another.

like image 782
Trufa Avatar asked Oct 13 '10 21:10

Trufa


People also ask

Can I include one HTML file in another?

Embedding an HTML file is simple. All we need to do is use the common „<link>“ element. Then we add the value „import“ to the „rel“ attribute. Using „href“ we attach the URL of the HTML file, just like we are used to when it comes to stylesheets and scripts.

HOW include HTML in PHP?

Use PRINT or ECHO With this method, you can include the HTML inside of the PHP tags. This is a good method to use for adding HTML to PHP if you only have a line or so to do. "<i>Print works too!

How do I display the content of one HTML page in another?

You could use an <iframe> in order to display an external webpage within your webpage. Just place the url of the webpage that you want to display inside the quotes of the src attribute. Show activity on this post. Either you use an iframe or you load the site via AJAX into a div (e.g. using jQuerys load() method).


1 Answers

Have you tried:

<object type="text/html" data="file.html"></object> 
like image 89
Victor Avatar answered Sep 28 '22 02:09

Victor