Html 将网站嵌入我的网站
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7890160/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Embed website into my site
提问by user979626
What I am trying to do is embed a website into mine. When you search something on their page their embed site redirects through their pages though it will still be on my web page. Any help will be appreciated. I have partnered up with this site and they don't know how to do it themselves.
我想做的是将一个网站嵌入到我的网站中。当您在他们的页面上搜索某些内容时,他们的嵌入站点会通过他们的页面重定向,尽管它仍然在我的网页上。任何帮助将不胜感激。我已经与这个网站合作,但他们不知道如何自己做。
I am sorry if this is confusing. Here is a example if it helps
如果这令人困惑,我很抱歉。这是一个例子,如果它有帮助
<html>//my site
<header>//my site
</header>//my site
<body>//my site
//where embed website is with their page redirects and search engine
</body>//my site
</html>//my site
When you search on their site or go to their pages link on their site. This should be like this in way.
当您在他们的网站上搜索或转到他们网站上的页面链接时。这应该是这样的。
<html>//my site
<header>//my site
</header>//my site
<body>//my site
//new page on the embed site after redirect
</body>//my site
</html>//my site
Any thoughts or places I can go help me figure this out.
我可以去的任何想法或地方都可以帮助我解决这个问题。
回答by loic17
You can embed websites into another website using the <embed>
tag, like so:
您可以使用<embed>
标签将网站嵌入到另一个网站中,如下所示:
<embed src="http://www.example.com" style="width:500px; height: 300px;">
You can change the height, width, and URL to suit your needs.
您可以更改高度、宽度和 URL 以满足您的需要。
The <embed>
tag is the most up-to-date way to embed websites, as it was introduced with HTML5.
该<embed>
标签是最先进的最新方式嵌入网站,因为它是用HTML5引入的。
回答by Emmanuel N
Put content from other site in iframe
将其他网站的内容放入 iframe
<iframe src="/othersiteurl" width="100%" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
回答by Till Helge
You might want to check HTML frames, which can do pretty much exactly what you are looking for. They are considered outdated however.
您可能想要检查HTML 框架,它几乎可以完全满足您的要求。然而,它们被认为是过时的。
回答by Brian Kunick
**What's the best way to avoid a fixed size, i.e., to have the embedded website scale responsively to the browser's window size? I'd like to avoid scroll bars within my website. – CGFoX Feb 2 '19 at 15:52
**避免固定大小的最佳方法是什么,即让嵌入式网站根据浏览器的窗口大小进行缩放?我想避免在我的网站内出现滚动条。– CGFoX 2019 年 2 月 2 日 15:52
**Is it possible to set width and height to percentages instead of absolute pixels? – CGFoX Mar 16 at 11:53
**是否可以将宽度和高度设置为百分比而不是绝对像素?– CGFoX 3 月 16 日 11:53
ANSWER: <embed src="https://YOURDOMAIN.com/PAGE.HTM" style="width:100%; height: 50vw;">
回答: <embed src="https://YOURDOMAIN.com/PAGE.HTM" style="width:100%; height: 50vw;">