#### Archived

This topic is now archived and is closed to further replies.

# Web programming questions #3 - frames Vs CSS-P

This topic is 5191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''ve heard a couple of times that frames are viewed as a bad way of doing things these days. CSS-P(ositioning) is the only alternative I know of, but first is it actually frowned upon to use frames or not? If so can someone suggest a good reference/tut for CSS-P for someone already knowing CSS? The reservation I have against not using frmes is this: Suppose you have a set of 10 linked pages, all very simple. You want a navigation bar too. With frames you write the simple pages quickly and one navbar page. Without frames, do you not have to cut''n''paste it''s code into every page in the sequence? I''m presuming if frames are not in vogue that there is a way round this?

##### Share on other sites
Hmm, I''ve found a couple of problems with frames:
look here The navbar frame gets stretched by the banner ad so it scrolls even when it shouldn''t need to. In addition the main page loads the navbar each time it changes to show which is the active page but they don''t change together and it''s horrible! Is the latter a frames problem or a ''my sucky javascript'' problem though?

##### Share on other sites
Do you use server side scripting? (PHP) ?

In which case you''ll simply include() the navigation bar into the current page.

Definitely learn CSS, it''s invaluable for styling your pages.

You can cheat by doing layout with a simple table, which is styled using CSS.

Proper layout in CSS that works on all browsers can''t be learned in a day, it''s hard.

Using frames makes it hard to bookmark your site. You don''t want that, do you?

##### Share on other sites
You could use tables - then in the navbar cell you would use an iframe to load the navbar page. Quick and easy.

##### Share on other sites
Ah yes, tables. If I had a 1 row, 2 column table with the navbar on the left and the main page on the right, can I get the left cell not to scroll as with frames so it''s always at the top of the page? Or do I need to use <div>?

##### Share on other sites
I would recommend that you don't use tables for layout, css is so much easier once you get the hang of it:
#nav{   position:absolute;   left:  0;   top:   0;   width: 12em;}#main {   left:  0;   top:   0;   margin-left:  12em;   height: 100%;   width:  100%;   overflow: scroll;}

Frames have some disadvantages like being hard to bookmark, if you don't have to use them you probably shouldn't

[edited by - twanvl on March 6, 2004 9:41:51 AM]

##### Share on other sites
look here If you see what I'm doing when the main page is too long to fit, it scrolls vertically but the navbar doesn't. This is something very important to me. Can it be done without using frames, I've looked at div and absolute positioning but they don't seem to help? Unless I took away the page scrollbar and let the main div section have one, but that's real ugly!

[edited by - d000hg on March 6, 2004 10:01:41 AM]

##### Share on other sites
Grrr, I''m sure I saw an example of what I want in CSS a couple of days ago but no idea where. It had a stationary navbar and scrolling main window like I want. Kind of urgent, if anyone knows of an example or how I can achieve this...

(oh and I''m tinkering with my site so don''t be surprised if it does vry bizarre things!)

Anyone?

##### Share on other sites
have you thought about using the iframe tag? I use it as you can embed it into the page anywhere you want and attach css to it.

a site I did with it

is this what you are after?

• 15
• 9
• 13
• 41
• 15