www.webdeveloper.com
Results 1 to 6 of 6

Thread: iframe kind of application in boxes??????

  1. #1
    Join Date
    Jul 2007
    Posts
    39

    iframe kind of application in boxes??????

    Hi eveyone,
    i made my first web site using frames as the layout. and i used iframe in one of the cells and i used that cell as target cell, , so that i could have my links open in that cell. (Oh my god, my English is terrible, even i myself didn't understand what i meant ) How can i do the same if i decide to use containers, boxes and cards as layout devices instead of frames/tables. i mean can i say thay if somebody clicks on that link, open the page in this specific card instead of a new window? I hope i am understandable, thanks in advance, Best regards
    Hamit

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    containers, boxes and cards
    Huh?

  3. #3
    Join Date
    Aug 2007
    Location
    London
    Posts
    410
    well, I'm not quite sure what you mean by "containers, boxes and cards" but I would always avoid using frames, I coded one of my sites with them and swiftly dumped them.
    For layout I would use <div> tags and then lay them out with css. You can do that by having a piece of code like:

    HTML Code:
    <div id="layer1">
    Hello, this is a div
    </div>
    And then in a seperate, linked, css style sheet have a piece of code like this:

    Code:
    #layer1 {
    width:300px;
    height:200px;
    }
    or some such.

    If you need help with <div>s and css then go here:
    (html) : http://www.w3schools.com/html/default.asp
    (css) : http://www.w3schools.com/css/default.asp

    Divs are much easier to use than frames, and much more accessible.

  4. #4
    Join Date
    Aug 2007
    Location
    London
    Posts
    410
    Quote Originally Posted by hmtpn
    Thanks a lot for your answer to my following post: http://www.webdeveloper.com/forum/sh...d.php?t=166708

    And may i ask something again? oLets say that i tried using <div> for layout purposes, how can i have a link page be opened in one of the div's (as in iframe) instead of a new window. i mean can i use the id of the div as the target name? if yes, another question is: are those sections liquid or firm (will they stay still evn if i try to place something bigger than them, or will they fit the size of the items in them, so massing whole layout up? (Excuse my English again) Thanks in advance, regards
    Hamit
    Ok, basically <divs> will do whatever you want them to, for example: if you wanted them to automatically resize to fit the content you would use
    Code:
    width:auto; height:auto
    . If you wanted the overflowing content to fit into the div, with a scrollbar, you'd use
    Code:
    width:200px; height:200px; overflow:auto;
    and so if the content was bigger than 200x200 pixels, a scrollbar would appear.

    Divs are not like iFrames, they are merely layout thingies... however, if you'd like to load content on a page inside a div, you can use javascript to load content using code a little like this:
    (if the div's id is "layer1")

    Code:
    function loadText(text) {
    	document.getElementById('layer1').innerHTML = "<p>"+text+"</p>";
    }
    Or some such, I've never tested that with external text documents though, but it might work with XML by using an XMLHTTPRequest, I think.

    I hope that helps. I tend to use PHP for changing content and I would most definitely recommend PHP.

  5. #5
    Join Date
    Jul 2007
    Posts
    39
    Thanks for the last explanations, they are sooo useful. What i want to do is, to make some menus, and when the user click on any menu item the relevant page should open in the div i want. (This could even be another web page, not just some content of a document. )

  6. #6
    Join Date
    Aug 2007
    Location
    London
    Posts
    410
    I personally would refrain from using iFrames even for navigation like that; they don't really conform to W3C standards...
    Instead, it is far better to use different pages for your documents, which carries the additional bonus of people being able to bookmark your pages.
    I used frames for my original website, but I got rid of them very quickly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles