PDA

View Full Version : Are frames bad?



don
Feb 24th, 2003, 06:06 PM
I am fairly new to web development and would like advice.

When I first started I heard that frames were bad and should be avoided. I have a couple of web sites to develop that have a common header and footer that I'd like to simply put into frames and then have two frames in the middle, one for navigation and the other for the meat of the apps.

Right now I'm using tables which, for whatever reason, don't render themselves right about 5% of the time. Also, using the tables makes kind of ugly code with the <table> tag in the header include and </table> in the footer include.

Any input is greatly appreciated.

cg9com
Feb 24th, 2003, 06:53 PM
well, in my opinion frames arent exactly bad, they just have a few issues like bookmarking certain pages isnt possible, also search engine submission can be tricky i hear.

i dont use frames often, i stick with iframes (rarely) and scrolling divs, to give the same type of effect.

as far as the tables, some say table based layouts arent the way to go. personally i use both.
unless your terribly worried about browser support, i say go with a more css based layout, customized divisions for layout will make for much cleaner code, make sure you stick to web standards.

don
Feb 24th, 2003, 07:42 PM
At the risk of sounding dumb, what do you mean by CSS based layout? I think of CSS as a way of identifying fonts, colors, borders, etc. Is there something I don't know.?

Also, I can't believe how stupid I have been in putting my entire page into one huge table instead of a table for the header, one for the body, and a third for the footer. Oh well, live and learn.

On the use of frames, one advantage I found is that you can always keep the footer at the bottom of the page, regardless of whether or not content scrolls it off.

Thanks for your input. Anyone else?

Cybertooth Tiger
Feb 24th, 2003, 08:03 PM
I have never been a big fan of frames, in fact i have only created one site out of,, ummmm, gee must be around105 sites.

We have a big one we are just starting, and the only "cost effective" solution to what the client wants is frames.

Search engine recognition is not a big factor for him, fast, efficient and timely updates are. His customers find him. (Nice to be wanted.)

I await more response and feedback.

Tonz

Roy Sinclair
Feb 24th, 2003, 08:20 PM
If your heading and footing are the same on all pages I can understand why frames look so attractive. You only need the code for the heading and the footing in a single file which makes any changes to either a simple task to accomplish. Without using frames the normal way is to have that same code in every page and you have to edit all those pages every time you change a part of it.

That said, there's a simple way to get the advantages of frames without going to frames. You can use "Server Side Includes" (SSIs) in your pages to bring in those pieces into your basic template while still maintaining them as separate files. The drawback to SSIs is the names of your files will likely have to be changed from *.htm or *.html to *.stm or *.shtml (depending upon your provider) and the slight increase in server overhead to search your files for the include directives.

You definitely want to extract those elements into standalone tables or format them using CSS so they don't have to be built into the rest of your page content they way you say they are right now.

Grant Palin
Feb 24th, 2003, 08:28 PM
How about scrolling div's? Can it be done (make div's scroll)? Does it work well? Like frames?

cg9com
Feb 24th, 2003, 08:33 PM
Originally posted by don
At the risk of sounding dumb, what do you mean by CSS based layout
using divs on the page: <div class="blah"></div>
and using css positioning, floats ect. to create the layout, and customize all the extra color,font attribs. ect. for each div.
i can help you out more, but no time now. :eek: :eek:

Grant Palin:
<div style="overflow:scroll;"></div> or overflow:auto would make it scroll when the content exceeds the div. very handy :thumbsup:

Grant Palin
Feb 24th, 2003, 08:56 PM
So are scrolling divs good to use in place of frames/iframes? How to divs work in browsers, in terms of support?

Catman
Feb 24th, 2003, 09:13 PM
From what I've seen, support is reasonably good in browsers 5.0 and up (and Mozilla 1+).

don
Feb 24th, 2003, 09:41 PM
Where can a find an exhaustive source on the net for all of the CSS attributes? W3Schools, as great as they are at explaining things, doesn't give much in the way of details.

Thanks again for all the help.

Catman
Feb 24th, 2003, 10:06 PM
I've found Brian Wilson's IndexDot References (http://www.blooberry.com/indexdot/index.html) a good resource.

AgaBoogaBoo
Feb 24th, 2003, 11:00 PM
Unless what your working on is critical, use frames. Experiment with them for however long even if it is for a year. There is no better way than to learn. When I started out, I used frames, stuck with them for quite some time (7 to 8 months) and then towards the end, I became quite good about them and found ways around the problems. Today, I realize they are good in certain situations where you can't use PHP, SSI (server side includes) etc.

select sires
Feb 25th, 2003, 12:29 AM
is it possible to use both a table and frames on a page?

can the top half of the page be a talble, and then the bottom
half consist of frames, does that work?

cg9com
Feb 25th, 2003, 04:00 AM
Originally posted by don
Where can a find an exhaustive source on the net for all of the CSS attributes? W3Schools, as great as they are at explaining things, doesn't give much in the way of details.
Thanks again for all the help.
try this for CSS:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/attributes.asp

Grant Palin:
it depends on your needs whether you should use an iframe or a scrolling div.

select sires:
yes, you can use tables and framesets, so long as you use the tables in the page that the frameset is displaying and not the page that the frameset is in.
if you are using iframes, then it can be placed in the same page as your tables, because it is an inline frame, designed for use in any normal html document.

select sires
Feb 25th, 2003, 04:59 AM
ok..i think i get it.
so what i am wanting with this (http://filebox.vt.edu/users/lkornhau/main.html) is wrong, because they're not the same page, not the page that the frameset is displaying?
is that why I can't get my frameset to show, or is that just an error on my part?

thanks, ss.

Grant Palin
Feb 25th, 2003, 05:18 AM
It's a personal site, so I'm not too worried about compatibility issues and such...but I would like my site to be fairly usable by other vsitiors. That said, I'm going to try using an Iframe and see how it goes. I'll just include a link to the sitemap for people who can't view iframes.

cg9com
Feb 25th, 2003, 05:22 AM
ss,
you are close, a frameset should be in its own document, the frameset will display the other pages you specify, "left.html" ect.
try reading this:
http://htmlgoodies.com/tutors/fram.html

Grant Palin
Feb 25th, 2003, 05:47 AM
Originally posted by cg9com
Grant Palin:
<div style="overflow:scroll;"></div> or overflow:auto would make it scroll when the content exceeds the div. very handy :thumbsup:

Thanks, I gave that a try. It doesn't work:( I put the div in a table, and gave it some content, but the whole page scrolls, not the div itself. I put the page online:
http://www.freewebz.com/hommworld/Other/Untitled.htm

Did I do something wrong:confused:

cg9com
Feb 25th, 2003, 06:12 AM
give your div a width and height. sorry i wasnt clear at first
overflow:scroll will give both scrollbars, you can also use "auto" which will just use a vertical bar when needed, if you dont like it.

ronaldb66
Feb 25th, 2003, 10:39 AM
Select sires,

a page either has a body element or a frameset element (using classic frames, not iframe), not both. How a browser will display a page that has both depends on the browser, but it rarely will be what you expected, and is fundamentally incorrect.
If you want to mix regular content and frames, look at the iframe element; using classic frames, a pure frameset document is the only way.

Borgtex
Feb 25th, 2003, 12:55 PM
Personally, (and answering the original question), I hate see how main page menu dissapears when you scroll a page without frames (or iframes). Also, as said, you only need to modify one page if you want to change something.

don
Feb 25th, 2003, 08:54 PM
I hope folks are still on this thread.

Are there issues with PHP and frames?

Regarding the menu... it scrolls off the screen and that's no good. Hopefully I can stick with frames.

By the way, thanks for the input. I am the sole IT guy and you guys make it feel like I work in a gigantic cube farm of nothing but IT folks. :)

cg9com
Feb 25th, 2003, 10:01 PM
nah, you wont have issues with PHP and markup, unless of course you do it wrong. lol

Grant Palin
Feb 26th, 2003, 03:08 AM
Originally posted by cg9com
give your div a width and height. sorry i wasnt clear at first
overflow:scroll will give both scrollbars, you can also use "auto" which will just use a vertical bar when needed, if you dont like it.

Didn't work:(. Have another look...
http://www.freewebz.com/hommworld/Other/Untitled.htm

cg9com
Feb 26th, 2003, 06:04 AM
div doesnt actually support those, and it would need a pixel value such as width="100px".

add your sizing to the css, like so:

<div style="overflow:scroll;width:100px;height:100px;">
hello
</div>

inline style tags can get a bit lengthy, you could move it into an external css file, and refer to it through there.

Grant Palin
Feb 27th, 2003, 08:05 AM
Okay, that worked. I don't think I'll bother using it further, since the usability is limited.

zoobie
Feb 27th, 2003, 09:35 AM
I was framed once...:D

Grant Palin
Feb 27th, 2003, 05:20 PM
Cute...

cg9com
Feb 27th, 2003, 08:03 PM
lol

I think the support is pretty widespread now ....
but i dont keep copies of diff. browsers to test.

don
Feb 27th, 2003, 09:00 PM
So the answer to my original question is "you can use them if you want" :confused:

Borgtex
Feb 28th, 2003, 12:34 AM
Err.... well... yes, the possibility of using frames at your will is implied in their existence, isn't it?

cg9com
Feb 28th, 2003, 01:02 AM
you can emulate the look of a frame with a <div>, and proper CSS.
you could have some static, and some with scrollbars to look like a frameset, but actually isnt, and still gives the same effect.
but if you actually want to load seperate pages easily with hyperlinks, then use an iframe. im not quite clear on iframe support.

meow
Feb 28th, 2003, 06:58 AM
Yes. :p