Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize frames to center the document

Status
Not open for further replies.

Light777

Programmer
May 15, 2003
32
0
0
US
I have a Frameset with a top frame, a left frame, and another left frame and a right frame. The purpose of the second left frame and the right frame is to center the document in the center of the screen.

A representation of this:

|--|-------------|--|
| | | |
| |--|----------| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
|--|--|----------|--|

Is there anyway to resize the side frames via the screen size? Or is there a better way to do this?
 
You can set the frames widths or heights in pixels or in percentages. This example shows the use of both

<frameset cols=&quot;65,*,65&quot;>
<frame src=&quot;c1.htm&quot; />
<frameset rows=&quot;90,*&quot;>
<frame src=&quot;r1.htm&quot; />
<frameset cols=&quot;20%,*&quot;>
<frame src=&quot;c3.htm&quot; />
<frame src=&quot;c4.htm&quot; />
</frameset>
</frameset>
<frame src=&quot;c2.htm&quot; />
</frameset>

Clive
 
That only reduced the content...I set the side frames to 30%, and the middle to 627 px, which I know is the exact proportions of the middle content, and it reduced the content in the middle. I've also thought about doing it in JavaScript with:

{function SetSize()
Space = ((screen.availWidth - 627)/2)
LeftFrame.Cols = Space + &quot;,*&quot;
RightFrame.Cols = &quot;*,&quot; + Space
}

Or something to that effect...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top