: 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
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?
More posts by @Deb1703797
2 Comments
Sorted by latest first Latest Oldest Best
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
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;
}
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.