开发者

CSS three-column layout

I'm looking for the best way to accomplish the following layout. I need to accommodate a header and footer of varying size, of which I am not in control. In between those elements, I need to set up a fixed three column layout. T开发者_Python百科he total layout needs to always print on one standard page in landscape mode. If I didn't have to allow for the header/footer, I know I could just use a fixed layout... but I can't. The layout needs to be:

variable height header

div with three fixed width columns

variable height footer

p.s. sorry, don't yet know the proper way to display this graphically here :(


If you're looking to have text divided into three columns, for a treat, you could try CSS3's columns:

  • http://www.w3.org/TR/2001/WD-css3-multicol-20010118/
  • http://www.quirksmode.org/css/multicolumn.html

This however, is not supported in older browsers.


If you want to control how your page prints, use the @page rule, like this:

<html>
    <head>
        <style type="text/css">
            @page
            {
                size:portrait;
                margin:1in;
            }
        </style>
    </head>
    <body>...</body>
</html>

More info on @page can be found on the W3C's CSS 2 spec.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜