Results 1 to 24 of 24

Thread: [RESOLVED] Iframes

  1. #1

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Resolved [RESOLVED] Iframes

    for an Iframe do i still need to put the <noframes> tag or is that only with regular framesets...also how can i get the backround of my frame to be different from the background of the other areas or become transparent to completely show the main pages background?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Iframes

    <noframes> is for framesets. IFrame is something different from frames, so the answer to your question is, no, you don't need <noframes>

    You can 'set' a background to an iframe by loading an html page in it which contains the background you want.

  3. #3

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    can i do it through css though? i wanna keep all my styles on 1 place for easy editing

  4. #4
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Do you have an external style sheet? That is ALWAYS what I use. It allows you to get the most functionality out of CSS.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  5. #5

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    yes i do and its posted on my other forum u helped me out with

  6. #6
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Then why not just link the page that the iFrame points to, to that CSS document:
    HTML Code:
    <iframe src="blah.html">
    HTML Code:
    <!-- inside blah.html -->
    <link href="MyStyles.css" rel="StyleSheet" type="text/css">
    That is how you get the iFrame to have the styles you want.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  7. #7

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    i dun really understand where i put this... do i put it in the existing style sheet? or do i have to create another one

  8. #8
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Thats what I meant when I asked if you had an external stylesheet. As in it is stored in a .CSS file and referenced from all you HTML pages. Is that what you have?

    I'm guessing not because you don't know here to put that. The second snippet of code I posted goes in the <head> section of every HTML document that uses those styles.

    It is also put in the <head> section of the page that is loaded in the iframe.

    Does that make sense?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  9. #9

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    i have everyone of my pages already linked to an external style sheet.
    but wenever i go to the #frame part that is the actual frames styles (position so far)
    and add a differenty background url it has no effect on the frame wen i view it.

  10. #10
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Once again: can you upload you source in a .zip or link me to the site so I can see the actual code.

    I'm not sure I understand you totally, but I think you are trying to edit the background by changing it like this:
    HTML Code:
    <iframe src="myFrame.html" style="background-color: #000000;">
    When you should be doing it like this:
    HTML Code:
    <iframe src="myFrame.html">
    HTML Code:
    <!-- inside myFrame.html -->
    <html>
    <head>
    </head>
    <body style="background-color: #000000;">
        blah
    </body>
    </html>
    Obviously you would be using classes and external stylesheets, but I think you get the idea.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  11. #11

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    heres the link to the site...
    http://ninjanutz.t35.com/index-framed.php


    sry if ur confused..ima explain wat i wanna do once again..
    i want to be able to have 2 backgrounds...one for the frame and one for the other parts or at least make the frame background transparent so the underlying background can show through.
    but i want to use the existing style sheet so i can keep all my styles in one place.

    once again sorry for the confusion
    Last edited by ninjanutz; Aug 9th, 2005 at 08:00 PM.

  12. #12
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Ok. I am going to try to clear up the basic understanding of this again which will hopefully lead to you solving the problem.

    When you specify a Source for an iframe an HTML page is loaded inside that frame EXACTLY the same way any HTML page is loaded inside a browsed window. That means that the ONLY thing that control the background of the page withing the iframe is the page that is loaded inside the iframe.

    The page that has the <iframe src="blah.html"> tag on it has NO control over what the background color of the iframe is.

    An illistraction of this is: If you loaded http://www.google.com inside your iframe, you have no way to change the background then, because it is Google's page.

    In other words, if you want to change the background of the iframe then you need to do so through frame-styles.css (which applies to html-framed.php).

    I think there is a slim slim slim slim chance that you could set the background-color of your iframe to transparent and get the effect you want (with the pictures), but I really doubt it.

    I would say if you really want the effect you are going for then don't use iframes at all, frames are not reccomended by W3C.

    PS - Thank you SO much for using proper XHTML, I hate seeing sloppy HTML.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  13. #13

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    lol yea no prob about the xhtml i read its better and decided to upgrade

  14. #14

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    i tired putting a <div class=''> tag on each page then use styles to change that background but this ended up overriding all my styles that were preset for those pages. i also tried adding a different background for just the part apprearing in the frame but the background it inserts is way smaller than the size of the whole frame. im gonna try to figure this one out on my own (maybe add it to the individual sections that add enough padding to make it the size of the frame) thank u for ur help eyeRmonkey but if u have any other suggestions feel free to post (i will not resolve this thread until i get it)
    Last edited by ninjanutz; Aug 10th, 2005 at 09:06 PM.

  15. #15
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Quote Originally Posted by ninjanutz
    (maybe add it to the individual sections that add enough padding to make it the size of the frame)
    Can you explain that a little better please?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  16. #16

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    wen i add the background to the id chat in my style sheet (the chat is the text that apprears in the frame immediately wen clicking on the link) it only adds the background to tahts small area of 2 lines. i was thinking of add enough padding to the id chat so that wen the background is shown it is not the full size of the frame.

    is this possible?

  17. #17
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Sorry, I don't what you mean by ID chat. You mean you add a background to a <font> tag or <span> tag? Yes, then the background will only go that far. If you want it to span more of an area it is better to use <div> or a <table>.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  18. #18

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    i used the div for it but it was still not anywhere near the full size

  19. #19
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    The link to your site doesn't work anymore. Can you show me what you currently have again (with a link perferably).
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  20. #20

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    yea it doesnt work cause i renamed the files its now http://ninjanutz.t35.com/index.php

  21. #21
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Iframes

    Ok, now that I have the code to view again. What are you trying to do this time? Get a background behind what? The div? I still say you should ditch iFrames all together and just use a table and add the navigation/header stuff to every page. If you are using php you can dynamically write the naviagation/header around each page. That would be a better solution and would load quicker and would fix your background problems.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  22. #22

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    yea i am using php but im new at it so i wouldnt no how to go about this

  23. #23

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Iframes

    k i found out how to do it. it looks complicated but i have a step by step guide. thanx for all the help.

  24. #24
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [RESOLVED] Iframes

    Ok, I'll skim over the concept incase you are interested. I don't know PHP so I will type out what the code should do:

    In the generic template:
    HTML Code:
    <% figure out how to link documents together in PHP (load a document into this one. Similar to how you load you CSS document into every HTML page. Except you will have many many documents to load into this one (1 document for ever page of your site. It should look something like this: #include src="index.php". In the second code thing below is an example of what index.php might look like. %><html>
    <head>
        <title>
            My Website || <% doc.write sTitle %>
        </title>
    </head>
    <body>
    <table>
       <tr>
           <td>
               <!-- Standar naviagation stuff here (that will be on every page -->
           </td>
       </tr>
    </table>
    <span class="largeTitle">
        <% doc.write sHeaderTitle %>
    </span>
    <% doc.write sBody %>
    </body>
    </html>
    index.php
    HTML Code:
    <% declare variables %>
    <% sTitle = "Home" %>
    <% sHeaderTitle = "My Webpage" %>
    <% sBody = "<span class='IntroTest'>welcome to my cool webpage.</span> This is my dynamically generated home page.
    <table>
        <tr>
            <td>
                YAY!
            </td>
        </tr>
    </table>" %>
    Feel free to ask me to explain any of that if you didn't get it. If you understand it, but don't know how to do it I would reccomend http://www.w3schools.com for PHP tutorials or just google for "PHP includes".
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width