HTML & CSS
I need help regarding iframe.
I want to show certain portion of another website into my site.
So it is possible to select only certain portion of any site and display that into my site.
That site contains a form, and only that form, I wanna show into my site.
How can I ?
A few points to make first:
1) iframes are depricated. Not recommended.
2) Some people would frown upon "linking in" a page from another site that is not yours, kind of like hotlinking images only doing so with the whole page.
3) Depending on what kind of form that is, what kind of information is collected and how it is submitted, you could get listed as a fraud/scammer unless you make it clear where form is from. I would say just don't do it.
4) iframes will show the whole page you link to. Like the name implies, it's just a frame, you can set the size and position but otherwise the page will be served exactly as if you were to go to it normally in a browser.
5) If you know the construction of a site - say the form is located in an include file somewhere that you could use - you would have access to the code and should be able to copy it over. No need for iframes!
6) I would suggest making it clear that anything you "link in" with a frame is clearly marked as part of another site, if you do so. But I still don't recommend iframes AT ALL.
But even after all that WHY wouldn't you create your own form? There is no reason you should be pulling in someone else's form in a frame. Better to just link to the original page, take a screencap for a placeholder if you must, or better yet, make your own form. And don't be afraid to ask for help here if you need it.
While iFrames are NOT deprecated (at least in the current HTML 4.01 specification)... they are frowned upon by pretty much the entire industry because they constitute a lot of problems for the end user in terms of usability and accessibility - which could lead to greater problems for you in the future than simply using outdated code. Other than that, I agree entirely with huit, don't leach off other peoples stuff, either link to the resource if your visitors need to use that particular form, or produce your own one, don't just "patch" together something which is reliant on other peoples content, the costs far outweigh the benefits.
I was certain iframes were deprecated...
And Alex's comment made me think of one more reason not to use iframes with someone else's site (though I guess he kind of stated this in a more general way):
The page you link in is not under your control and could change, break or have down time without notice. You'd be at the mercy of the other webmaster and their hosting provider. If they have a problem, so do you.
Well actually I too dun wanna use iframe.
But then I can't access the database of the other site. as itz a govt. site of my country.
So all I can do is link it with my site either by anchor tag, or with iframe.
But my client want to show that form within our site. and there the prob arises.
But now I'm thinking in making him understand the disadvantages of iframe.
No, they weren't deprecated in HTML 4.01 though obviously were "not allowed" in 'Strict DTD' (that's probably why you thought the were deprecated) but they were a "problematic" concept hence never entered 'Strict'.
Actually the OBJECT theatrically was supposed to be the favoured method for such embedding using only HTML.
You can wish to use IFrame incase it is neccessary as if there is no other alternate!, and ofCourse you can use IFrame with in the DIV and you can position that DIV into your HTML file.... and apply the style properties for div as well as Iframe as per your requirement.