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

How to make column fixed width?

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
Hello, I've found a good CSS layout that I want to use:

Problem is that the right-hand column becomes tiny when the browser is resized smaller. I inserted a 220px image in the right-hand column but if the browser width is smaller than around 1000px then the image either pushes to the right of the column or is pushed completely to the bottom of the page.

Any ideas on how to make the right-hand colum a fixed width so that it displays my 220 pixel image correctly, regardless of the browser width?

Thanks,
May
 
I wonder if you're ready to take on such a big and demanding layout if you are not familiar with basics. Anyway, here's the amazing fix. Right-hand column will remain fixed at 220px if you give it a width of 220px. Who would have thought, hey? At the moment, your right column has a width of 42.8%. That means that it expands and contracts relative to its container, which is apparently set relatively as well. If you want to have a fixed width without changing at different resolutions, you need to use fixed units, like pixels. Find #rightColumn, find width: 42.8%; and switch it to width: 220px; But don't expect the design not to break after that. I guess that is one of the pitfalls of not creating a design yourself.
 
Hi Vragabond, I've already tried that. It seemed the obvious thing to do but it doesn't change the layout at all, which is odd.

I also tried making other container widths to 240px, which I though should be wide enough to hold my image but this hasn't worked either.

Any ideas?

Thx,
May
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top