Frames and Framesets or ???

Thread Solved

Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Frames and Framesets or ???

 
0
  #1
Nov 28th, 2008
This is problem one of the most annoying concepts I have come around to after using several internet programming languages.

I have frames set out like so:
11111
23334
55555

I hope people can understand that lame drawing :p
Now what I wish is that all the frames stay in that layout when present in each browser, firefox, ie, safari, etc and do not change like I have at the moment. Same code 3 different browsers 3 different layouts
Any idea how to get this done so there all the same across all browsers?

I have used pixel based, percentage based, any other ideas?
or maybe best just to get a tag all together?

Thanks, Regards X
Last edited by OmniX; Nov 28th, 2008 at 6:05 pm.
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 101
Reputation: ingeva is an unknown quantity at this point 
Solved Threads: 9
ingeva ingeva is offline Offline
Junior Poster

Re: Frames and Framesets or ???

 
0
  #2
Nov 29th, 2008
This doesn't look very hard, but I wouldn't use frames if I could avoid it. I would use divs instead.
With frames, define three of them, above each other:

11111
xxxxx
55555

Define the "xxxxx" frame as a frameset with three frames: 2, 3 and 4.

Didd this help?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: Frames and Framesets or ???

 
0
  #3
Nov 29th, 2008
So your saying throw frames out all together?

But I require 2 navigation menus, 1 main navigation menu and one sub menu...

So how would you code that whole thing in divs?

Dont forget I require them to work like frames and I dont want the pages reloading everytime and so forth?

I experiment with iframes but I couldnt specifiy the x and y values.
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 101
Reputation: ingeva is an unknown quantity at this point 
Solved Threads: 9
ingeva ingeva is offline Offline
Junior Poster

Re: Frames and Framesets or ???

 
0
  #4
Nov 30th, 2008
The concept of frames may disappear from the Web altogether, but it will take several years so using frames will still be a convenient solution for a long time. However, it's by many considered to be a bad one. I've personally used frames but have now gotten rid of them altogether. By re-using much of the code in a website, you can utilize the browser's caching so that reload times are kept to a minimum.
To achieve this you might need to use somewhat advanced scripting, both on the server and client sides, and you might want to use sessions and cookies as well.

There's a "half way" solution: You can use two frames where one is invisible (zero size). This is used to load HTML content from the site, and place it in the "div"s on the visible page by using JavaScript "innerHTML". Thus only the changed code is loaded, like you want to achieve, and the programming of the site will be easier and much more flexible. It all depends on how well you master JavaScript code. And of course, use of CSS.

With this solution you get rid of, to a large extent, the rigidity and difficulty of maintenance as you will experience with "regular" frames.

AJAX might also be a way to go, but I haven't gotten that far myself ....
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: Frames and Framesets or ???

 
0
  #5
Nov 30th, 2008
Ya I can see what your seeing if I could understand how to do it with divs I would its like...

You know how you have those websites with a border around it and centered in the middle of the page?

Or if you just cut out the side borders so you only utilize the middle part?

How would you do that?

I thought frames do this only what else?

Thanks, Regards X
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 101
Reputation: ingeva is an unknown quantity at this point 
Solved Threads: 9
ingeva ingeva is offline Offline
Junior Poster

Re: Frames and Framesets or ???

 
1
  #6
Nov 30th, 2008
I would define margins:
If I have a "div" that I want to center, I define its margins like this:

margin: 1em auto 2em auto;

This example gives me a space of 1em above, 2em below, and automatic margins that would center the div horizontally. If it's inside another div, it would be centered in the outer div.

You should define sizes of elements as "em"s or percent. NEVER use px -- it's still allowed, but it's oldfashioned and inflexible. If you use percent, you can have sizes of elements automatically adjusted according to the size of your window, and if you use ems all you have to do to change the size of all elements with "em" size is by adjusting the font-size of "body".

For an example, check out my side http://upandforward.com , and adjust the width of the browser window. Text and image sizes will follow. There are no restrictions for looking at the html code if you want to, but the original php code will normally not be available.

I had another site which might be a better example because it did something like you are looking for, but it broke a stupid law. I was simply not allowed to tell the truth, and I'm just an old fool who still prefers the truth beats anything else.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: Frames and Framesets or ???

 
0
  #7
Nov 30th, 2008
Ok I think you got me on the write track so if I have used margins to center the image now what do I do if I want to open another frame in that window, use iframe?

I use pixels never em because im always trying to judge against images not font sizes, should I be used em instead?

Thanks, Regards X

PS: I have alot of work today but I aim to get started on this sometime today
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 101
Reputation: ingeva is an unknown quantity at this point 
Solved Threads: 9
ingeva ingeva is offline Offline
Junior Poster

Re: Frames and Framesets or ???

 
0
  #8
Nov 30th, 2008
I feel that I haven't answered your previous question in full. Most elements can have borders. Define a nice one with shadows like this:

border: .2em outset #00b;

which defines a border, 0.2em thick, that's lighter to the top and left, and darker to the bottom and right. Here the color is light and dark blue.

For three divs placed inside an outer div (for the middle "frame") you would define
float:left;
for all of them, or possibly
float:right;
for the last one.

If you use pixels for sizes you might have to change it 101 places if you want to change the layout of your site, so if you want a lot of maintenance work, that's what you should do. Otherwise, except for the <body> element, use em or percent for sizes. They are valid for all kinds of elements. For images, specify only the width; the aspect ratio will be kept and the picture will not look stretched. This way you can make images of different sizes occupy the same horizontal space -- or you may use height instead if you want to.

Iframes are as "bad" as frames. They represent a solution that's easy to implement but hard to maintain, and will be deprecated with time. The best solution is to adhere to web 2.0 standards, but I can't advice on that yet since I've just started studying it.

I warmly recommend the book "CSS, the missing manual" that you can find on Amazon. It's worth many times the cost.

I would use W3C's validity check to check for HTML errors. I would also convert all old HTML code to XHTML, which means you separate contents and layout completely. That's not possible with frames.
W3C can also check your CSS files separately.

Just as I use only one set of XHTML I use one CSS file for all browsers. Under normal circumstances you can code so they look the same in all newer browsers. This could mean that you may have to use "double divs" some places to get margins and padding right. Otherwise, specifying three floating divs like above, you only need to specify the with in percents, for instance 20, 60, 20. I would make the total slightly less than 100 to make sure that the rightmost one is not moved below the others.

At last: Do NOT worry about download times. You'll be surprised how fast everything goes if you can utilize the cache. The cache doesn't have to be large. Mine is only 8MB, which is more than sufficient even for fairly large pictures.
Last edited by ingeva; Nov 30th, 2008 at 11:05 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: Frames and Framesets or ???

 
0
  #9
Dec 1st, 2008
After reading your post I am alot more informed now. Thanks.

But your post begs the question, what do I use instead of frames?
(Yes I dont like them but what else can be used to open a webpage inside a webpage?)

Thanks, Regards X
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 611
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: Frames and Framesets or ???

 
0
  #10
Dec 1st, 2008
Ok I have been trying to use the method you suggested and it works for now BUT when I fix it and it look aligned.

Still begs the question what am I to use for my navgiation bar?
What am I going to use for my window that opens those links from the naviagtion bar?

This why I thought frames are the only answer?

You help me answer this and then ill convert from frames to divs forever!!!
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC