Computing.Net > Forums > Web Development > Alternative to frames

Alternative to frames

Reply to Message Icon

Original Message
Name: Dr. Nick
Date: August 17, 2004 at 16:49:37 Pacific
Subject: Alternative to frames
OS: WinXP Pro SP1a
CPU/Ram: P4 2.0Ghz / 1024MB
Comment:

Hey all,

I've just been given a smallish website that currently uses frames. I personally feel that frames are on their way out, with the exception of a few specific cases, and that they cause too much headache to use in a public webpage (search engines, orphaned pages, etc.)

What's the best way to layout a page instead of using frames? Tables? DIV sections?

Any ideas or past experiences that worked well for you?

Thanks!


Report Offensive Message For Removal

Response Number 1
Name: -Bryan-
Date: August 17, 2004 at 18:41:02 Pacific
Subject: Alternative to frames
Reply: (edit)

CSS

-=Bryan=-


Report Offensive Follow Up For Removal

Response Number 2
Name: SN
Date: August 17, 2004 at 18:58:16 Pacific
Subject: Alternative to frames
Reply: (edit)

I've used tables and divs...tables are by far the more popular approach. Lately I've been attempting to achieve all my visual and layout effects using only CSS, DIVs, and SPANs. I think it works out quite nicely and produces code that is much easier to maintain than approaches I've tried previously.

I know you're not new at the programming game, but I thought I'd mention that nearly all the problems with frames can be solved with javascript. This has been discussed a few times in this forum and the programming one, so I won't repeat it here.

If the frame is used for navigation, make sure you make the pages dynamically (using SSI, PHP, Perl, whatever) so you don't have to change each page when the navigation changes. If you happen to have a hankering for ASP.NET, use a custom control...They're about the most pimpin' feature for web developers out there. Frames, despite their shortcomings, are infinitely better than having a hundred copies of the same code.

-SN


Report Offensive Follow Up For Removal

Response Number 3
Name: Dr. Nick
Date: August 18, 2004 at 10:25:47 Pacific
Subject: Alternative to frames
Reply: (edit)

Thanks SN.

I thought about just biting it and going with frames (after I toss in the required Javascript like you mentioned), but I'm still looking more towards either tables or DIV sections.

Here's a question for you: If you've been working with a DIV layout, how have you gotten past the browser compatibility issue with the DIV padding attribute?

Basically from what I've seen, IE renders DIV padding so that if you increase the padding, it increases the internal padding of the section. The Gecko engine (used by all the Mozilla browsers) does it the opposite way, adding additional padding by extending the section outward (which is just plain stupid).

Did you use some browser detection code or come up with some other way to make it look good in both browsers?

Thanks again.


Report Offensive Follow Up For Removal

Response Number 4
Name: SN
Date: August 18, 2004 at 18:57:32 Pacific
Subject: Alternative to frames
Reply: (edit)

Nick-
I haven't seen the behavior you're talking about. Of course, I rarely care very much about precise layout as most of my sites are meant to be more functional rather than aesthetic. However, I checked out this page in firefox and IE 6 and they rendered it identically (a green box with a pink box inside, but with 10px of green padding):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<TITLE>test</TITLE>
<STYLE type="text/css">
.outside {
height: 300px;
width: 300px;
background-color: green;
padding: 10px;
}
.inside
{
height: 100%;
width: 100%;
background-color: pink;
}
</STYLE>
</HEAD>
<BODY>
<DIV class='outside'>
<DIV class='inside'></DIV>
</DIV>
</BODY>
</HTML>

Would the above page cause the behavior you're talking about? You're pretty much saying gecko interprets padding as margin, right?

Luck,
-SN


Report Offensive Follow Up For Removal

Response Number 5
Name: Dr. Nick
Date: August 19, 2004 at 20:07:35 Pacific
Subject: Alternative to frames
Reply: (edit)

You're pretty much saying gecko interprets padding as margin, right?

Ha, that would be a bit easier to say.

I was actually referring to a problem I've had before. You said there's nothing like beating a dead horse, what about a horse that's dead, rotting, and crawling with maggots?

Anyway... I ended up just leaving the frames as they are because I don't have time to rewrite the page using tables, though I did replace some useless graphics with a DIV layout. Believe it or not, it's cross compatible with IE and Mozilla, shock! (for the moment anyway).


Report Offensive Follow Up For Removal


Response Number 6
Name: coachdaley
Date: September 3, 2004 at 22:39:55 Pacific
Subject: Alternative to frames
Reply: (edit)

Hey,

I know you guys are hard core coders but why couldn't you use Dreamweaver templates or FrontPage Shared Borders instead of frames.
Don't slam me too much. I'm the tech at a school and have to run around fixing stuff on 3 campuses so just don't have time to type out code even if I wanted to. I did teach myself to make pages with code some years back but just need to speed to get the pages out.
Oh yeah, I still use frames but only for nav on the left and body on the right, with an occassional header frame.

Coach


Report Offensive Follow Up For Removal

Response Number 7
Name: SN
Date: September 6, 2004 at 21:00:22 Pacific
Subject: Alternative to frames
Reply: (edit)

"why couldn't you use Dreamweaver templates or FrontPage Shared Borders instead of frames?"

For several reasons:
1. These tools cost money
2. The tools may have automated way of producing the desired effect, but it still comes down to making the HTML - Tables or DIVs instead of frames, which is what we've been discussing.
3. Most people used to having complete control over their sites prefer not to work in a WYSIWYG development environment. In fact, most of us consider typing out the code faster than using WYSIWYG programs because we don't have to deal with the mutilated code those programs develop, or with the difficulty the resulting pages have when viewed in different browsers.

You use WYSIWYG tools because you don't have time to type out the code...We type out the code because we don't have time to deal with WYSIWYG.

-SN


Report Offensive Follow Up For Removal

Response Number 8
Name: coachdaley
Date: September 13, 2004 at 19:58:29 Pacific
Subject: Alternative to frames
Reply: (edit)

This is true but not everyone has that luxury.
And for me, if the page shows up to the viewer in the end then that is all that counts.
Extra bytes of code, mutilated or not are not getting in the way.
Coach


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Alternative to frames

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software