Forum Moderators: not2easy

Message Too Old, No Replies

CSS to work like Frames?

         

svoltmer

2:29 pm on Jun 26, 2003 (gmt 0)

10+ Year Member



Hello,
I was wondering if it were possible to load HTML pages into specific <div>'s within a page to achieve the effect similar to "targeting" with Frames?

BlobFisk

3:18 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi svoltmer,

Unfortunately not. Frames (and iFrames) are seperate pages within a page. They have their own URL and their own Document Object Model.

<div>'s are objects on a page, and do not have a seperate URL, so unfortunately you cannot load another URL into them.

svoltmer

4:01 pm on Jun 26, 2003 (gmt 0)

10+ Year Member



Thanks!

So, maybe I should use anchors for all my <a href>'s and just put all my information into a <div> that has scrolling enabled?

BlobFisk

4:05 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can certainly put the information into the <div> with scrolling enabled - but watch browser support on this. NN4.7 is very, very dodgy on scrolling layers.

I'm not 100% sure as to what you mean about anchors though...

MWpro

4:08 pm on Jun 26, 2003 (gmt 0)

10+ Year Member




<div>'s are objects on a page, and do not have a seperate URL, so unfortunately you cannot load another URL into them.

you can always use a serverside include (i use php for it) to put the contents from a different file into the div.

<div id="whatever">
<?php include("file.php");?>
</div>

Works great for menus; however I am not sure if this is what svolt wanted to achieve.

drbrain

4:57 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For browsers that support the fixed value of the position attribute (not WinIE, but MacIE does), you can have scrolling and non-scrolling content, just like frames.

See CSS2 Section 9.6.1 Fixed Positioning [w3.org]

DrDoc

9:23 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are a couple threads in the forum library about how to acheive frame emulation using CSS

CritterNYC

5:40 am on Jun 27, 2003 (gmt 0)

10+ Year Member



There are a couple threads in the forum library about how to acheive frame emulation using CSs

A great example of a site using CSS to mimic some aspects of a framed document is at Salia.com [saila.com]. You'll also find some excellent content that has been mentioned serveral times on WebMasterWorld including CSS Layouts [saila.com], HTML is not an acronym [saila.com] and Lorem Ipsum [saila.com] (Just in case you've ever wondered what the heck it is.

Unfortunately, he doesn't have a stripped down explanatory file explaining his technique. Maybe he'll write one if we ask nicely. :)