Log in

View Full Version : Iframe problem.



Hyperactive
07-17-2007, 10:36 PM
I'm very bad in english, but i try to explain my problem as good as i can.

I'm using Iframe to include page (For example, google.) in my site.
I've tried to divs and many methods to get iframe like this: (Its hard to explain, so i made image, SECOND image )

http://img119.imageshack.us/img119/9126/iframeexif7.jpg
TO
http://img119.imageshack.us/img119/2174/iframeex002ab7.jpg

So, how i can make iframe box with no scrolling, and what automaticly
center it in one point. (Look second image, its help to understand)

As i before said, i've tried divs, and other things, but they are very bad,
and they aren't working on other broswers, like firefox.

Im glad if anyone can help with this, i hope you understand my english. ;)

jscheuer1
07-18-2007, 03:28 AM
This looks OK for the American Google:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.goo {
width:480px;
height:111px;
position:relative;
overflow:hidden;
}
.goo iframe {
width:480px;
height:350px;
position:absolute;
top:-150px;
left:-20px;
}
</style>
<!--[if IE]>
<style type="text/css">
.goo iframe {
left:0;
}
</style>
<![endif]-->

</head>
<body>
<div><br>&nbsp;</div>
<div class="goo"><iframe src="http://www.google.com" scrolling="no" frameborder="0"></iframe></div>
</body>
</html>

But, if anyone used it, the results would be in the same iframe and mostly obscured by its size, lack of scrolling, and the division above it which partially masks it.

Note: Google does offer free or cheap code to put their search on your page.

Hyperactive
07-18-2007, 09:05 AM
Thank you very much, i've searched code like this long time.
Thank you ! :)

chechu
07-18-2007, 11:30 AM
Hey guys,

I used the above code mentioned, and the one in this link http://www.dynamicdrive.com/forums/showthread.php?t=22424 , but I always can only see a part of the width I place. Does it interfere with other divs I have on my site ? Here's the css (http://www.hetbestevoordeel.be/style/stylesheet.css)
Any ideas ?

jscheuer1
07-18-2007, 03:09 PM
chechu,

In the beginning, I answered this thread just to see if I could get it to work. I knew without trying that it wasn't that good of an idea, especially with something like Google, for the reason I mentioned in my previous post. There are other reasons that would apply to any such setup, however it is done:


The content provider may change their layout, throwing off all your previously calculated dimensions.
It is a mild form of stealing content.
You have no control over the content. This means that you must test in every browser because you cannot know with any certainty how the layout and styles of the provider, once placed in your iframe will react with any given browser.
The content you are taking/using may change address or simply stop being provided.

chechu
07-18-2007, 09:17 PM
The content provider may change their layout, throwing off all your previously calculated dimensions.
It is a mild form of stealing content.
The content you are taking/using may change address or simply stop being provided.

No problem, as the content of the iframe would be of another site of mine ...

You must test in every browser because you cannot know with any certainty how the layout and styles of the provider, once placed in your iframe will react with any given browser.

This could worry me. But if you look at my stylesheets, is there something that could cause the problem ?

jscheuer1
07-18-2007, 09:34 PM
No problem, as the content of the iframe would be of another site of mine ...

This could worry me. But if you look at my stylesheets, is there something that could cause the problem ?

Mmm, well then let us first be sure that the test page I provided works for you in your current browser. If it does, try adding it to your page while keeping American Google as the content. If that still looks good, switch to your content. At this point, you will probably need to adjust some of the styles. It was only worked out for American Google.