Mobile app version of vmapp.org
Login or Join
Deb1703797

: Can I create a div to display web content from another website? Let's say my homepage is www.example.com and I want to add a div on it. When people visit my page, I want to show the content

@Deb1703797

Posted in: #Html

Let's say my homepage is example.com and I want to add a div on it. When people visit my page, I want to show the content from google.com within the div.

When visitor clicked any link on google.com, it redirects user all within the div. Is it possible to do? If so, how?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

Or you could grab the contents of the other page/site and load it into the div.


Dynamic creation (serverside language)
Ajax creation (using javascript and a your serverside language)


You can now use something like PHP's file_get_contents("the-web-page-url") to load the content into a div

10% popularity Vote Up Vote Down


 

@Courtney195

No, the element you are looking for is an iframe, which does about exactly what you ask.
There's a mayor downsite to this: This is bad for seo, you don't get points for the content in the iframe.
Also, you can't Iframe Google, they don't allow you to. Other sites will work.



The default styling of an iframe is a bit (well, a lot) ugly, so with some basic styling it will look more like the "div-look":

iframe{
margin: 0;
padding: 0;
border: 1px solid #000 ; /* Can be [none] too */
display: block;
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme