Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 打印css样式表-div定位_Html_Css_Printing_Stylesheet - Fatal编程技术网

Html 打印css样式表-div定位

Html 打印css样式表-div定位,html,css,printing,stylesheet,Html,Css,Printing,Stylesheet,嗨,我刚刚完成我的网站。我的印刷风格有问题。我的html如下所示: <div id="container"> <div id="main"> <h1>title</h1> <div class="blockright">image in here and text</div> <p>paragraphs of text</p> <div class

嗨,我刚刚完成我的网站。我的印刷风格有问题。我的html如下所示:

<div id="container">
<div id="main">
       <h1>title</h1>
        <div class="blockright">image in here and text</div>
         <p>paragraphs of text</p>
<div class="blockleft">image in here and text</div>
 <p>Even more paragraphs of text</p>

 <div class="clear"></div>

 <div class="footer">Copyright here</div>
</div>
</div>

标题
这里的图像和文本
段落

这里的图像和文本 更多的段落

版权所有
.blockright具有固定宽度并向右浮动

.blockleft具有固定宽度,而Float left具有自动宽度

.main具有宽度并包含内容

在我的打印css中,我希望.blockleft和.blockright与页脚之前的打印页面底部对齐。网站上的每个页面都必须是可打印的,我不想手动重新定位页面以打印文章,也不想为每个页面设置自定义样式以正确打印。有人知道如何使div与页面底部对齐吗。我试过绝对定位,但没能成功。有什么想法吗


非常感谢您的打印样式表

 #main {
   position:fixed;
   bottom:0;
   left:0;
   display:block
}

如果您不想让所有的#main都位于底部,只需在.blockleft和.blockright周围环绕另一个div,并将此css应用于它。唉,这在IE6中可能不起作用,但是您可以尝试应用一些用于将粘性页脚应用到页面的技术。下面是一个例子

它现在看起来怎么样,使用