26

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.

2

4 Answers 4

51

You can embed websites into another website using the <embed> tag, like so:

<embed src="http://www.example.com" style="width:500px; height: 300px;">

You can change the height, width, and URL to suit your needs.

The <embed> tag is the most up-to-date way to embed websites, as it was introduced with HTML5.

6
  • 4
    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. Feb 2, 2019 at 15:52
  • Is it possible to set width and height to percentages instead of absolute pixels? Mar 16, 2020 at 11:53
  • I don't know @CGFoX... I didn't find a solution after searching for one on the web
    – loic17
    Apr 2, 2020 at 8:29
  • Seems like Emmanuel's answer is the solution: stackoverflow.com/a/7890207/2745116 Apr 2, 2020 at 9:03
  • 1
    embed and i frame not working beacase of SameOrigin xframe
    – user13767678
    Mar 22, 2021 at 10:43
25

Put content from other site in iframe

<iframe src="/othersiteurl" width="100%" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
0
6

You might want to check HTML frames, which can do pretty much exactly what you are looking for. They are considered outdated however.

2
  • 3
    if frames were outdated 4 years ago already, would it be possible to update this answer with a more recent way of doing this? Aug 21, 2015 at 11:03
  • 6
    10 years now, this answer should be removed
    – zappa
    Jan 24, 2021 at 8:21
4

**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

**Is it possible to set width and height to percentages instead of absolute pixels? – CGFoX Mar 16 at 11:53

ANSWER: <embed src="https://YOURDOMAIN.com/PAGE.HTM" style="width:100%; height: 50vw;">

Not the answer you're looking for? Browse other questions tagged or ask your own question.