Wierd IFrame problem

Associate
Joined
1 May 2006
Posts
810
Location
Bristol, UK
Hoi guys.

I'm developing a site for a mate and as the title suggests, I'm having trouble with my iFrames.

The testing site can be found Here and as you can see, the text in the "main" frame isn't taking up the whole page. Instead it has been squashed down and had a scrollbar added.

Here is the iFrame code:
Code:
<iframe src="/blog.php" frameborder="0" id="main" scrolling="auto" width="100%">
Ideas?
 
Freakish_05 said:
Hoi guys.

I'm developing a site for a mate and as the title suggests, I'm having trouble with my iFrames.

The testing site can be found Here and as you can see, the text in the "main" frame isn't taking up the whole page. Instead it has been squashed down and had a scrollbar added.

Here is the iFrame code:
Code:
<iframe src="/blog.php" frameborder="0" id="main" scrolling="auto" width="100%">
Ideas?

You need to set a height for the iframe as well as a width.
 
Cuchulain said:
100% isn't a valid height, you need to set it in pixels.
I'm on the verge of doing this as it seems to work fine. However, putting 100% against width works. Plus I'm trying to make the layout adaptive so that it expands to fit the whole of the screen. If there is another way of doing this then please clue me in :)

Cheers.
 
Freakish_05 said:
I'm on the verge of doing this as it seems to work fine. However, putting 100% against width works. Plus I'm trying to make the layout adaptive so that it expands to fit the whole of the screen. If there is another way of doing this then please clue me in :)

Cheers.

Dont use iframes, simple as that. Unless you're including content from an external web site there are countless other ways of doing it, PHP, ASP, SSI's. If you have to use iframes and the content is hosted on your domain you can use an autosizing iframe that'll fit to exactly the right height of the content contained within it. More details here: http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm
 
You mention using PHP. How exactly would this work exactly? I'm using PHP/MySQL to run the site. Blog/Fav links page even the navigation links are controlled via a database.

I'm assuming you're talking about doing something like show region if variable "page" = "links". In which case how would I go about implementing it?

Cheers.
 
Freakish_05 said:
You mention using PHP. How exactly would this work exactly? I'm using PHP/MySQL to run the site. Blog/Fav links page even the navigation links are controlled via a database.

I'm assuming you're talking about doing something like show region if variable "page" = "links". In which case how would I go about implementing it?

Cheers.

using an include is probably the easiest way

e.g. <?php include 'somepage.php'; ?>
 
Forgive my ignorage, but this is all new to me. :rolleyes:

So I've got all of my pages (that I was going to link to with an iFrame). How do I get these to display using includes.

Cheers for all your help, its is VERY much appeciated (especially as now I should be able to ditch frames :D)
 
Freakish_05 said:
Forgive my ignorage, but this is all new to me. :rolleyes:

So I've got all of my pages (that I was going to link to with an iFrame). How do I get these to display using includes.

Cheers for all your help, its is VERY much appeciated (especially as now I should be able to ditch frames :D)

Remove the target from the links and just create a PHP page for each section, if you need to include any PHP code or script just use a PHP include on the relevant page, you can stick one anywhere on the page you like, in a div, table cell (if you've not used CSS for your layout) etc.
 
Back
Top Bottom