50 users online (1 members and 49 guests)  

Thread: Help Please


  Results 1 to 7 of 7
  1. #1
    thereeper's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2003
    Posts
    4

    Question Help Please

    Alirght, On my Index Page, I have a link for three different files.

    One each I want to use a seperate CSS so each one will give my site a different color scheme. The secondary pages, have an inline frame, so I put the <LINK REL=STYLESHEET TYPE="text/css" HREF="http://www.mysite.com/1.css">
    in the style part. It changes the secondary index, but when I click links, the inline frame does not have the CSS colors. I could go to every single page, and put the css in manually, but then I would have to do this 3 times for each different color scheme.( I do not want to have 3 different copies of all the files on my site, since updating would take too much time, but I do want 2 different secondary indexs that give all the other files that are in the inline frame, 3 sets of different colors (or themes)) So is there anyway to get the inline frame to take on the CSS of it's parent page? That way I could make the three different Secondary Indexs with three different CSS files.

    Any help would be much appriecated
    Last edited by thereeper; 11-28-2003 at 02:50 AM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya, welcome to the forums.

    There is no direct way to have the inline frame document inherit the stylesheet, as they are technically different documents.

    However, we can use JavaScript to detect the parent, and load a specific stylesheet.

    Here is a very good article on 'swapping' stylesheets and alternate stylesheets in general -

    http://www.alistapart.com/articles/alternate/
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    thereeper's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2003
    Posts
    4
    Quote Originally Posted by QuietDean
    Hiya, welcome to the forums.

    There is no direct way to have the inline frame document inherit the stylesheet, as they are technically different documents.

    However, we can use JavaScript to detect the parent, and load a specific stylesheet.

    Here is a very good article on 'swapping' stylesheets and alternate stylesheets in general -

    http://www.alistapart.com/articles/alternate/
    Alright, I read that article... That sounds like a good solution, but I can't figure out which script to detects the stylesheet of the parent. Any help would be much appriecated

    It seems there should be a way to atleast get the style of another page, if the css was entered directly into the parent page, it might be easier?
    Last edited by thereeper; 11-28-2003 at 02:56 PM.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    How about showing us your page? it might help for this bit.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    thereeper's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2003
    Posts
    4
    Quote Originally Posted by QuietDean
    How about showing us your page? it might help for this bit.
    www.thereeper.com/testindex.html

    when you go through the html (last part of head), you can see that one links for the first css http://www.thereeper.com/images/1.css

    The page itself takes on the css colors, but any inlineframes do not. I tried puting just default white pages with default text, and they didn't take on the parent page's css. I'm prepared to change every inline frames html, but I need it to work when I make 3 different indexs. Because I know I could just put the css directly into each page or link it, but then I would have only one color scheme, instead of the three I want to be choosable on the index (since it's linked to 3 different secondary indexes with their own css files)..

    (I put a colorless test page on the upperight)

    Thanks, Dave
    Last edited by thereeper; 11-28-2003 at 03:06 PM.

  6. #6
    thereeper's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2003
    Posts
    4
    "trap the css in a session variable and link to the css off of the session variable"

    This was suggested to me by someone, but I have no idea how to do this, hehe...

    any help would be much appriecated

  7. #7
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Heh, well its one way of doing it.

    It might be easier tho to trap the css in a cookie rather than a session, as we can then use JavaScript instead of server-side code.

    Introduction here - http://hotwired.lycos.com/webmonkey/98/29/index1a.html
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?