#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    in a hollow
    Posts
    2
    Rep Power
    0

    css for an iframe


    i did a search on this topic and got some results, but i had most of the suggestions already in use, or i didn't understand the explanations, so i went ahead and posted another thread with specific examples of my code. just wanted to say that so people didn't think i was spamming the fora with already posted topics.

    anyways, i have an index file linked to a css file in the root directory. in the index is an <iframe> that links to a file in a sub. i tried a number of variations for placement of the class property, but none of them seem to have an effect on the <iframe>. the cell the <iframe> is in was using a class, so i thought it would cover any content loaded by the <iframe>. but that didn't work. so i put the class in the <iframe> tag itself. that didn't work. then i put the class in a <span> within the file in the sub, and then had a <link> in the <head> of that same file point to the css file in the root. that didn't work. so i put a copy of the css file into the sub and changed the <link> to point to the copy of the css file. that didn't work. not sure where to go next, so i thought i would post it.

    for an example, here's a code snipet from the index file in the root -

    ____

    <link href="core.css" rel="stylesheet" type="text/css">
    </head>

    ...

    <td valign="top" class="mecontent"><iframe src="me/index.php" width="100%" valign="top" height="100%" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes" class="mecontent"></iframe></td>
    ____

    and here is a snipet from the index file in the sub -

    ____

    <link href="core.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <span class="mecontent">

    ...

    </span>
    ____

    if i load just the index from the sub, the content is affected. so im not sure why it won't change when loaded into an iframe in another page. any know how to fix this? thanks!

    fips
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Phila, PA
    Posts
    39
    Rep Power
    13
    Applying a style to an iframe ( <iframe class="yourclass" ...) will only work on the iframe object, not it's contents. Remember, it is a separate window.


    The stylesheet you're linking to in me/index.php isn't affecting the page because the path is wrong. Change it to this
    <link href="../core.css" rel="stylesheet" type="text/css">
    to indicate that the css file is in the upper directory.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    in a hollow
    Posts
    2
    Rep Power
    0
    i already tried that and it didn't work. thats why i tried putting a copy of the css file in the sub and having the index in the sub point to the css there, not in the root. that also didn't work.

    i was scanning around on google a few minutes before i droped by here and found the problem. its because the index was in php file format. why would that make it a problem? also, i have to redesign the whole site to be parsed on the server in php, how can i use <iframe> and css in a php environment, without the data being unformated? thanks for the response by the way.

IMN logo majestic logo threadwatch logo seochat tools logo