• Advertisement

Archived

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

Web programming questions #3 - frames Vs CSS-P

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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!)

Share this post


Link to post
Share on other sites
Not really - isn''t using iframes just as ''bad'' as normal frames? I was intrigued how you got the green curvy border and green scroll bar when your source doesn''t seem to utilise any CSS headers or inline sytles.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
frames are supported by most browsers theses days.

it was an issue back when they were not supported.

if a browser supports CSS then its gonna support frames.

The green outline was an image that I set as the table cell or tables background image.


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Netscape users, please don''t look at this site. But if you are talking about scrolling areas d00hg, www.x-l-r-8.co.uk if you click on one of the main icons, it will take you into a page. In there, if the text goes beyond the size of the area the scroll buttons will work. This page is only formatted to work under IE so NS users won''t appreciate it! Is that the sort of thing you need?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
A page with terrific examples of what can be done using CSS: <a href="http://www.csszengarden.com/">http://www.csszengarden.com/</a>.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement