943,729 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Nov 28th, 2008
0

Frames and Framesets or ???

Expand Post »
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.
Similar Threads
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Nov 29th, 2008
0

Re: Frames and Framesets or ???

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?
Reputation Points: 16
Solved Threads: 9
Junior Poster
ingeva is offline Offline
106 posts
since Jul 2008
Nov 29th, 2008
0

Re: Frames and Framesets or ???

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.
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Nov 30th, 2008
0

Re: Frames and Framesets or ???

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 ....
Reputation Points: 16
Solved Threads: 9
Junior Poster
ingeva is offline Offline
106 posts
since Jul 2008
Nov 30th, 2008
0

Re: Frames and Framesets or ???

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
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Nov 30th, 2008
1

Re: Frames and Framesets or ???

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.
Reputation Points: 16
Solved Threads: 9
Junior Poster
ingeva is offline Offline
106 posts
since Jul 2008
Nov 30th, 2008
0

Re: Frames and Framesets or ???

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
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Nov 30th, 2008
0

Re: Frames and Framesets or ???

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.
Reputation Points: 16
Solved Threads: 9
Junior Poster
ingeva is offline Offline
106 posts
since Jul 2008
Dec 1st, 2008
0

Re: Frames and Framesets or ???

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
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Dec 1st, 2008
0

Re: Frames and Framesets or ???

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!!!
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Plan for parsing HTML
Next Thread in HTML and CSS Forum Timeline: preview edit letter - div or iframe





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC