Results 1 to 4 of 4

Thread: Layout to fit the browser window

  1. #1
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Layout to fit the browser window

    I'm trying to create a page that will fit inside the browser window with a panel along the top, another along the left, and an iframe that uses the remaining space. This is exactly what I want to do: http://www.cabl.com/bar/ -- only that site is done with tables and I'm trying to do it with CSS only.

    I'm a noob just learning so maybe it's too advanced for me. The closest I've gotten is:
    Code:
    <div style="top:0; left:0; height:40px; width:100%; z-index:3;"></div>
    <iframe src="left.htm" style="position:absolute; top:0; left:0; width:150px; height:100%; padding-top:40px; z-index:2;"/>
    <iframe src="main.htm" style="position:absolute; top:0; left:0; width:100%; height:100%; padding-top:40px; padding-left:150px; z-index:1;"/>
    That works as far as placement but for some reason the frames are enlarged to more than width/height of the window (by exactly the amount of padding) so the window must be scrolled. I tried changing "padding-" to "margin-" and same result.

    Any tips, places to look, or even a "You can't do that with CSS stupid!" woud be greatly appreciated.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <html>
    <head>
    <title>Your Page</title>
    </head>
    <frameset rows="64,*">
    	<frame name="banner" src="banner.htm" scrolling="no" noresize target="contents">
    	<frameset cols="150,*">
    		<frame name="contents" src="left.htm" target="main">
    		<frame name="main" src="main.htm">
    	</frameset>
    	<noframes>
    	<body>
    
    	<p>This page uses frames, but your browser doesn't support them.</p>
    
    	</body>
    	</noframes>
    </frameset>
    </html>
    The only change you'll have to make is to include a "header.htm" for the top of your page. You may have to change your doc-type.
    - Mike

  3. #3
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks mburt, I know I could do it with a frameset but I'm trying to avoid that. The table method seems to work fine too but I was hoping for a better way to do it. I'm just learning CSS in depth and hoped I could make it work. CSS seems real nice in theory but too many problems to implement in the real world as yet. I should probably stick with tables I guess.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I should probably stick with tables I guess.
    Or, just use DIVs. Read this.
    - Mike

Bookmarks

Posting Permissions

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