|
A c t i o n f o r L i b r a r i e s
— F e b r u a r y 2 0 0 3
The Internet ConnectionBy Michael Sauers
More Two-column CSS Fun
What you cannot do to accomplish this is set the width of the menu column to npx and the width of the content column to a percentage like so: .menu {float: left; width: 150px} Although this may seem a logical solution, a problem arises when the screen gets too small; the content moves itself under the menu as shown at right:
.menu {float: left; width: 150px} In this example, we have still directed the menu to float to the left of the window and established its width of 150 pixels. However, the key here is what we have not directed the content to do. By not floating the content to the right or setting a column width, we overcome the problem of the content's moving below the menu. By not giving this information, the browser treats the content as if the width is 100 percent of the screen. Then, by giving the content a left margin of 20 pixels more than the width of the menu, the content appears 20 pixels to the right of the menu and seems to float to the right. Next Article | Previous Article | Table of Contents | BCR Publications Comments to:
shoffhin@bcr.org |