Forum Moderators: open

Message Too Old, No Replies

Centering a Frames based Website

Still using frames in my page and trying to improve it...

         

lotero

10:50 am on Apr 29, 2002 (gmt 0)



This is my first message to WebmasterWorld. Is it possible to center a website based on frames?. As the page containing the frames definition have no <BODY> tag, I don't know how to center it...

Thanks in advance...

tedster

11:19 am on Apr 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World. Hoope we can help you achieve what you are aiming for. Here's one idea.

You could create a blank or background colored HTML page, and place it as right and left frames of a nested frameset:

<FRAMESET COLS="*,770,*">

Then put the frameset for your website content in the 770 pixel middle column. The right and left column frames will automatically center it.

Macguru

11:40 am on Apr 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Saludo lotero!

And welcome to WebmasterWorld!

If you want to center a frameset vertically, you must put some "filler" pages on both sides of your frameset. The with of those will automatically adjust to the screen of viewers with the "*" attribute. You can use the same page for both sides, such as vertical_filler.htm:

<frameset cols="*,80">
<frameset cols="80,*" >
<frame name="leftFiller" src="vertical_filler.htm">
<frameset cols="80,*" >
<frame name="navFrame" scrolling="AUTO" noresize src="navframe.htm">
<frame name="mainFrame" scrolling="AUTO" noresize src="main.htm">
</frameset>
</frameset>
<frame name="rightFiller"src="vertical_filler.htm">
</frameset>

If you want to center it both horizontally and vertically, you need fillers on top and sides of your frameset.

<frameset rows="*,80" >
<frameset rows="80,*" >
<frame name="topFiller" src="horizontal_filler.htm" >
<frameset cols="80,*" >
<frame name="leftFiller" src="vertical_filler.htm">
<frameset cols="*,80" >
<frameset cols="80,*" >
<frame name="navFrame" scrolling="AUTO" noresize src="navframe.htm">
<frame name="mainFrame" scrolling="AUTO" noresize src="main.htm">
</frameset>
<frame name="rightFiller" src="vertical_filler.htm">
</frameset>
</frameset>
</frameset>
<frame name="bottomFiller" src="horizontal_filler.htm">
</frameset>

Enjoy!

<added> ARGH! tedster beat me again!</added>

<added again>fixed stuff, sorry!</added again>

(edited by: Macguru at 12:02 pm (utc) on April 29, 2002)

tedster

11:49 am on Apr 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe I beat you, but you gave such a detailed and complete answer that I am humbled!

lotero

12:49 pm on Apr 29, 2002 (gmt 0)



Thanks macguru for your quick answer. The web I need to "center" is <snipped url> The other one, <snipped url>, is personal (my village).

<snipped url> have 3 frames: up (80 rows), left (150 cols) and the rest. What I want to do is give some space to the left and right sides of the pages. Can you send me an exmaple, as I can not succesfully modify the examples you sent me? Thanks in advance...

(edited by: tedster at 9:57 pm (utc) on April 29, 2002)

Macguru

8:01 pm on Apr 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi again lotero,

It is not autorised to drop URL of sites you are building or related to, here at WebmasterWorld. You understand doing so can open the flood gates to self promotion. I understand here is not the case, but cannot review your site for this reason. We try to keep it general, without pointing to specific files.

Here is what I think can help you. File names and attributes will have to be modified to fit your specific needs. First create some empty html file in the same folder of your other frameset files and name it "shim.htm". This very same file can be the spacer you need on both sides or your actual frameset.

Then modify attributes and filenames in this sample code and paste it in your frameset file.

<frameset cols="*,80" frameborder="NO" border="0" framespacing="0">
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame name="leftFrame" scrolling="NO" noresize src="shim.htm">
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" noresize src="your_top_frame_file.htm" >
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame name="your_nav_frame" scrolling="NO" noresize src="your_nav_frame.htm">
<frame name="mainFrame" src="your_main_frame.htm">
</frameset>
</frameset>
</frameset>
<frame name="rightFrame" scrolling="NO" noresize src="shim.htm">
</frameset>

Good luck!

lotero

9:08 am on Apr 30, 2002 (gmt 0)



Thanks a lot, Macguru: it's a pleasure to be in contact with people that have a huge knowledge of what are doing...
My "frames based web" is now a little bit more reasonable. Do you think I should convert my Web to a NO frames format?. Thanks again...

Macguru

12:11 pm on Apr 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>Do you think I should convert my Web to a NO frames format?

If you care for people finding your site on serch engines, yes. Search engines spiders have great difficulty to properly index framed sites. When they can, they will index frames as separate pages. As a result of this, visitors will find your main framed pages alone, without your top and side navigation frames to discover the rest of your sites.

Of course, there are ways to avoid this, like using external redirection or write JavaScripts and filling the <NOFRAMES> tag with the actual (or better) content of your pages. It requires some work and used to lead for good results, not any more. I used to be a big frames fan not so long ago, but I switched. Since almost a year, some search engines dont give much importance to the <NOFRAMES> tag anymore and can penalise you for using JS redirects. The use of frames should be restricted to cases where the site's design makes it an absolute necessity.

WebmasterWorld archives are filled with information, about this topic. Feel free to use the "site search" feature (on top menu) to get all your awsers a lot faster. But I warn you, this can become addictive! :-)

tedster

12:30 pm on Apr 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd also like to raise the usability issue, in addition to the search engine issue. Back in 1996 I created my first commercial website for a client and I used frames. I liked the way navigation always stayed on screen.

A few years later, the client was struggling and asked what we might do to improve sales. At that point I had read enough anti-frames ranting that I was willing to experiment -- I "flattened" the website. Not only did my admin become much easier, but the server logs told the tale very quickly.

Page-views per unique nearly doubled - despite the fact that the old frameset naturally was giving 2 or 3 "bonus" page-views per screen. People simply stayed around longer and clicked on more pages. The newly flattened site began to grow and make more money. Today, they are quite profitable and continue to grow.

One website is not a scientific study, but this anecdote illustrates what I believe is a fact about frames. For some people, frames make sense. Somehow, that's exactly the way their brain organizes information and a framed site seems like the Promised Land of user interfaces.

But that's NOT everyone by a long shot. From the minute frames appeared on the scene, a good sized faction of the surfing public HATED them with a passion. I'm surmising that not everyone's brain organizes the world in the same way (that seems obvious after I say it) and only a certain percentage "get" frames.

Then there's all of Jakob Nielsen's observations about the way frames "break the metaphor" of the web. Consider the fact that bookmarking is out the window, for instance. Also consider the way that links for the currently displayed information stay active if they're in a separate navigation frame, meaning that people can click on active links that change nothing at all.

If you've got the time to spare, I'd encourage you to redesign. You just might find a wider audience.

lotero

11:35 am on May 7, 2002 (gmt 0)



Thanks a lot for your advices. I promise I will change my mind...