hmtpn wrote:Thanks a lot for your answer to my following post: http://www.webdeveloper.com/forum/showthread.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
width:auto; height:auto
. If you wanted the overflowing content to fit into the div, with a scrollbar, you'd use
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")
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.