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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintain frame width?

Status
Not open for further replies.

cobrien11

Technical User
Joined
Jul 14, 2000
Messages
110
Can anyone tell me how I stop a frame changing size when I minimise/maximise.

I have a frame which contains the menu on the left hand side of my site, I want to keep it a constant width whatever size the browser window is.

Any help would be greatly appreciated.

Thanks
 
Hello cobrien11!

It's very easy. You have relative frame size (probably in percents %) but you need absolute size - in pixels.

To do this:
1) open file that keeps all frames;
2) open Properties window (Window > Properties);
3) check Frame borders in View (View > Visual Aids > Frame Borders);
4) select border of the frame with menu (click on it);
5) set frame width in Properties window (for example 150) and select Pixels from the Unit drop down menu.

That's it!

Good Luck! :-)
 
Thanks for the reply Eugene but its still not working.

I've set the 'Column Width' to 130 and selected pixels in the frame properties. When I preview the page the left frame still changes width when I change the browser window size.

I haven't uploaded this site yet but our last site did the same thing, you can find it here if you want to check it out.

Thanks.
 
Hello cobrien11!

Do you know why? Because you set width of both frames (left and right) to absolute size - 134,718. And try to imagine what should the browser do if you resize window? It tries to resize both frames in its size proportions.

You need to set width of the left frame to pixels and width of right frames to relative size.
the code should look like this:

Code:
<frameset cols=[b]&quot;134,*&quot;[/b] rows=&quot;*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 
  <frame src=&quot;html/menu.htm&quot; noresize name=&quot;menu&quot; scrolling=&quot;NO&quot;>
  <frame src=&quot;html/home.htm&quot; name=&quot;content&quot;>
</frameset>

Mark that I changes size of the rifht frame to *

Now it MUST work! Good Luck! :-)
 
Ups!
The code should look like THIS:

<frameset cols=&quot;134,*&quot; rows=&quot;*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame src=&quot;html/menu.htm&quot; noresize name=&quot;menu&quot; scrolling=&quot;NO&quot;>
<frame src=&quot;html/home.htm&quot; name=&quot;content&quot;>
</frameset>
Good Luck! :-)
 
Thanks heaps Eugene, it works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top