Netizens often ask in forums, can I read the content of another html file in one html file? The answer is yes, and there is more than one method. In the past, I would only use iframe to reference, but later I found several other methods. So today I will summarize these methods for your reference. I think the third method is better. good!
Several ways to introduce other html files into html files
1.IFrame is introduced, look at the code below
You will see an externally imported file, but you will find that it is surrounded by something like an outer frame. You can use
But you will find that there is still a problem, that is, the background color is different. You only need to use the same background color in the imported file import.htm, but if you use
If you are using IE5.5, you can read this article about transparent colors. If you want to import a file that is too long so that the scroll bar does not appear, add
to the body in import.htm.Enter scroll=no
*Disadvantages: Unable to make navigation jumps, jump inside iframe, content overlay appears
2.
object tag — defines an embedded object (e.g. image, media, code, etc.)
* Concepts that do not conform to standard web design have been abandoned by standard web design.
3. Download method of Behavior