Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Convert HTML docs with frames into a single HTML doc?

by AidanLee (Chaplain)
on Nov 29, 2001 at 19:26 UTC ( #128372=note: print w/replies, xml ) Need Help??

in reply to Convert HTML docs with frames into a single HTML doc?

What might be easier than generating a table to build the final document is CSS-shaped-and-aligned <div> tags.

So, when analyzing the master document, you'll be able to acquire or derive the position and dimensions of all of the frames (you'd need this for building your tables anyways), and then you could wrap each child page (after removing html,head, and body tags) in this:

<div style="position:absolute; top: ?; left: ?; width:?; height:?;"> child page content goes here </div>

The big win here is you don't have to worry about grabbing the child documents in a set order. The absolute positioning will take care of visual ordering for you.

Replies are listed 'Best First'.
Re: Re: Convert HTML docs with frames into a single HTML doc?
by Masem (Monsignor) on Nov 29, 2001 at 19:33 UTC
    <HTMLPurist Mode>
    Never ever never ever ever never never use absolution positioning for anything in HTML. You have no guarentees on screen size and thus, you might be pushing your content off the sides of the screen. You should always use relative positioning or sizing.
    </HTMLPurist Mode>

    True, the end goal of the poster was not for a page to be published, but just to get down into one page that could be viewed offline, so absolute positioning is not bad. But as advice for those that are considering converting an entire frames-based site to something clean in CSS, this advice very much applies.

    That said, I have myself tried creating a CSS-based site that emulated tables using relative sizing (as opposed to absolute). The various bugs at the time between IE 5 and NS 4.x (this about 2 years) made me realize that this will not happen easily unless you stick with a very simple layout. I would suspect that absolute positioning would work like a dream, but again, that's the wrong approach for web publishing.

    Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
    "I can see my house from here!"
    It's not what you know, but knowing how to find it if you don't know that's important

      True enough, however assuming (a dangerous thing) that the target audience is using PC-only devices (as opposed to wireless/etc) it is usually safe to assume that there is room for two columns of frames in the window (the menubar/main real-estate phenomenon). Additionally, it is possible to use relative values with absolute positioning and widths

      <div style="position:absolute; top:0px;left:0px;width:100%;height: +100px;" > header real estate </div> <div style="position:absolute; top:100px;left:0px;width:20%;" > left menu </div> <div style="position:absolute; top:100px;left:20%;width:80%;" > main real estate </div>

      I'm not going to disagree with you that in general staying away from anything that assumes a particular screen size, but your same advice would also apply to

      • frames
      • tables with width/height specifications

      And since he's already got frames here, whether he picks tables to maintain his possibly-too-wide page format, absolute-positioned seems easier

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://128372]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2021-10-17 11:50 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (71 votes). Check out past polls.