🔒 Locked
Web programming questions #3 - frames Vs CSS-P
Advertisement
Original Post
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?
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?
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?
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?
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?
I would recommend that you don't use tables for layout, css is so much easier once you get the hang of it:
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]
#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]
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]
[edited by - d000hg on March 6, 2004 10:01:41 AM]
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!)
(oh and I''m tinkering with my site so don''t be surprised if it does vry bizarre things!)
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?
a site I did with it
is this what you are after?
You can use position:fixed to get the navbar staying on screen like a frame. Unfortunately this doesn''t work right in IE (what a shock), but the other browsers do it. I''ve been tempted to just tell IE users to get a clue, but I think it may be a better idea to use server-side script to spit out a frame for IE users and CSS for competent browsers.
The effect I want is exactly as can be found on my site - go to a page which is too long for the main frame and see how when you scroll down, the navbar stays at the top of the page. What I''m looking for is to do this without frames.
Alimonster:
It sounds like that''s what I want but if it''s not supported...
Are you talking about dynamically generating css files depending on the browser or just making a switch between frames+fileA.css or noframes+fileB.css - I''ve been wondering if you can use ASP/PHP to generate css files on the server at all.
Alimonster:
It sounds like that''s what I want but if it''s not supported...
Are you talking about dynamically generating css files depending on the browser or just making a switch between frames+fileA.css or noframes+fileB.css - I''ve been wondering if you can use ASP/PHP to generate css files on the server at all.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement