#1
  1. No Profile Picture
    Slightly Disturbed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    200
    Rep Power
    11

    Question CSS iframe buffer to div problem


    I have a page which has an iframe which buffers the pages that are passed to the div "content" layer. the page that is loaded into the iframe extracts the data from the database and then includes the template which also holds the css. this works when the page isnt loaded through the iframe to the div but doesnt when buffered and loaded. does anyone know what I could be doing wrong? do I need to put the css (which is just for font and text) on the page holding the iframe and the div layer? any help will be greatly appreciated, thanks in advance.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    111
    Rep Power
    11
    Funny, I just finished working on more or less the same problem myself. Though it isn't very clear what your exact problem is, I imagine that the data is extracted and displayed on your page correctly, while the css is missing completely.
    That's because only the <body> data is extracted from the iframe onto the page, while <head> data isn't. All you have to do is to copy the css from the page displayed in the iframe (is it called the child page? I'm not english speaking...), to the "parent" page, where the actual data is going to show up. Instead of having 2 pages with the same css, you could simply transfer the code to an external stylesheet.
    Cut the css code from your original page, paste it on an empty page (a notepad page will do), give it a name and an extension .css.
    Then put this link in the <head> section of your pages:
    <link href="--path_to_your_stylesheet--" rel="stylesheet" media="screen">.
    But probably you knew this already..

    Bye
  4. #3
  5. No Profile Picture
    Slightly Disturbed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    200
    Rep Power
    11
    thanks for your reply. everything runs from a database, the page content, images, pop up images and css, I have an index page which has the site banner and menu and below that the content div with the iframe hidden, each menu item targets base.html which extracts the data from the database and then includes("template") to determine how the page looks, then this is ran thru the iframe and into the div. what i did was include the css in the template, when I should have infact put it on the index page, now all this works perfect. I also have left it so that I can include external pages and run them thru the buffer also, as so I can "plug in" different things as they become needed..

IMN logo majestic logo threadwatch logo seochat tools logo