Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding a div from another website on my own (HTML & CSS)

Tags:

html

css

Is there a way to embed a div from another website on my own without using anything other than HTML and/or CSS? I have not really started on JS, jQuery or PHP yet so I would like to see if there is a way without it.

The div I would like to embed is: http://imgur.com/user/BeachyBoy/favorites/#likes

like image 901
Beachy Avatar asked Oct 26 '25 09:10

Beachy


2 Answers

You can use an iframe to insert content on your site from another domain. Not sure you can isolate just a single div though. The code to embed external content is:

<iframe src="http://addressofsite.com"></iframe>

see here for info on how to use the tag and all its available options.

like image 117
Giles Thompson Avatar answered Oct 28 '25 23:10

Giles Thompson


You can use iframe to implement. For example:

<iframe src="http://www.google.com" width="100%" height="4000" frameborder="0" scrolling="yes"></iframe>

If you need to import a chunk of the page, it is not possible only using HTML/CSS. it involves cross-domain issue, so jquery, ajax..are needed.

like image 45
yong wu Avatar answered Oct 29 '25 00:10

yong wu