- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我目前使用的 HTML 和内联 CSS:
<div style="width: 975px; clear: both; float: left; text-align: left; margin: 0;
background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0;">
<span style="font-style: italic; font-size: 13px; padding-left: 80px;">Test Group 1</span></div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; font-weight: bold; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; font-style: italic; font-weight: bold; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; font-weight: bold; font-style: italic; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
</div>
</div><div style="width: 975px; clear: both; float: left; text-align: left; display: block;
margin: 0; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
</div>
</div>
<div style="width: 975px; clear: both; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
<span style="font-size: 13px; padding-left: 130px;">L GROUP</span></div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
</div>
</div>
<div style="width: 975px; clear: both; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 390px; float: left; height: 20px; margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 324px; text-align: right; width: 60px;
display: block; position: absolute;">
<span id="lnkInvoice17">828</span></div>
<div style="font-size: 13px; padding-left: 264px; text-align: right; width: 35px;
display: block; position: absolute;">
5.00000%</div>
<div style="font-size: 13px; text-align: left; padding-left: 197px; width: 60px;
display: block; position: absolute;">
7/14/2010</div>
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00**</div>
</div>
</div>
<div style="width: 975px; clear: both; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 390px; float: left; height: 20px; margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 324px; text-align: right; width: 60px;
display: block; position: absolute;">
<span id="lnkInvoice18">828</span></div>
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$165,165.12</div>
</div>
</div>
<div style="width: 975px; clear: both; float: left; text-align: left; display: block;
margin: 0; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
</div>
</div>
这段代码基本上是一堆嵌套的 DIVS,用作可展开/可折叠的 div 结构。为了打印出来,我删除了所有功能。然而,问题是该页面在打印预览中显示完美......直到它需要分页到下一页。第二页的其余文本都在页面顶部乱七八糟:
有人知道发生了什么事吗?我假设这是一个 FLOAT 或 INLINE/BLOCK 问题,但我似乎无法弄清楚是哪个。
最佳答案
尝试使用这个 HTML
<div class="clearfix" style="width: 975px; float: left; text-align: left; margin: 0;
background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0;">
<span style="font-style: italic; font-size: 13px; padding-left: 80px;">Test Group 1</span>
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; font-weight: bold; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; font-style: italic; font-weight: bold; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; font-weight: bold; font-style: italic; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
</div>
</div>
<div class="clearfix" style="width: 975px; float: left; text-align: left; display: block;
margin: 0; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
</div>
</div>
<div class="clearfix" style="width: 975px; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
<span style="font-size: 13px; padding-left: 130px;">L GROUP</span></div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 3px double;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
</div>
</div>
<div class="clearfix" style="width: 975px; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 390px; float: left; height: 20px; margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 324px; text-align: right; width: 60px;
display: block; position: absolute;">
<span id="lnkInvoice17">828</span>
</div>
<div style="font-size: 13px; padding-left: 264px; text-align: right; width: 35px;
display: block; position: absolute;">
5.00000%
</div>
<div style="font-size: 13px; text-align: left; padding-left: 197px; width: 60px;
display: block; position: absolute;">
7/14/2010
</div>
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 8px; text-align: right; width: 70px; display: block;
position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 80px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; text-align: right; width: 70px; display: block; position: absolute;">
$0.00
</div>
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block; border-bottom: 1px solid;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00**
</div>
</div>
</div>
<div class="clearfix" style="width: 975px; float: left; text-align: left; margin: 0;
display: block; background-color: #D3D3D3;">
<div style="width: 390px; float: left; height: 20px; margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 324px; text-align: right; width: 60px;
display: block; position: absolute;">
<span id="lnkInvoice18">828</span>
</div>
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
<div style="font-size: 13px; padding-left: 175px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 90px; text-align: right; width: 70px;
display: block; position: absolute;">
$0.00
</div>
<div style="font-size: 13px; padding-left: 10px; text-align: right; width: 70px;
display: block; position: absolute;">
$165,165.12
</div>
</div>
</div>
<div class="clearfix" style="width: 975px; float: left; text-align: left; display: block;
margin: 0; background-color: #D3D3D3;">
<div style="width: 384px; float: left; height: 20px; margin: 0; display: block;">
</div>
<div style="background-color: #BEE0F7; width: 165px; height: 20px; float: right;
padding: 0; margin: 0; display: block;">
</div>
<div style="background-color: #CFF5CE; width: 166px; height: 20px; float: right;
margin: 0; display: block;">
</div>
<div style="background-color: #F0D3D3; width: 253px; height: 20px; float: right;
margin: 0; display: block;">
</div>
</div>
添加这个 CSS
<script type="text/css">
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
</script>
关于asp.net - CSS 嵌套 Div 打印问题 : Text bunches at top of second page,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3241578/
可以从 sklearn 获取“列标题”Bunch如Bunch.feature_names 。但是,这不会给出目标变量的“列标题”。如何获取目标变量的“列标题”? 例如对于 Iris 数据集: >>>
我在报告文件中有以下字符串: "Bunch(conditions=['s1', 's2', 's3', 's4', 's5', 's6'], durations=[[30.0], [30.0], [3
为了解析/创建 JSON 的简单性,机器学习应用程序通常使用 Bunch对象,例如https://github.com/dsc/bunch/blob/master/bunch/__init__.py
某些命令行工具允许“组合”短选项。 例如,tar 命令采用短选项 -x、-v 和 -f filespec。 它允许选项像 -xvf filespec 一样组合在一起,以避免空格破折号的冗余输入。 阅读
今天学习了《Python算法》这本书上的一个Bunch类 class Bunch(dict): def __init__(self, *args, **kwds): super
我有一个用于生成模式的 MySQL 工作台模型。为了玩弄它,我想要一堆假数据。有没有一种简单的方法来生成它,还是我必须手动完成? 最佳答案 这是我经常用来生成虚拟数据的网站。 http://www.g
我正在开发一个从服务器 API 下载图像的应用程序... 我们已经创建了一个 API,它提供图像 URL 的 JSON 响应... 我已经创建了用于显示图像的 GridView,它正在成功运行....
在我正在使用 Java 编写的程序中,我必须从文件中读取数据。数据经过格式化,以便每一行都包含构造新对象所需的所有信息。当我解析数据时,我有一个看起来像这样的代码块: String[] parts =
我需要在编译时计算传递给模板化结构的一堆数字的乘积。我成功地做了一个丑陋的解决方案: template struct mul_all { static constexpr std::size_
执行以下操作是否更快: if ($var != 'test1' && $var != 'test2' && $var != 'test3' && $var != 'test4') { ... } 或
几乎肯定是 XY problem但我想不出一种简洁的方式来表达我想做的事情。 我有一个文本区域。在此文本区域内,用户输入以逗号分隔的 ID 号列表。当他们单击“获取”时,我用逗号分隔他们的输入,以获取
我需要在几个事件结束时调用一个函数。假设我有 9 个点击监听器、10 个蓝色监听器、一些按键上/下监听器等。 解决方案是修改所有内容并添加函数调用。 但这……呃……蹩脚。 我是否可以一次性添加对所有事
var brightness = document.getElementById("brightness"); trash.addEventListener("click", function() {
希望这不是转载!我到处都看过,如果是的话,我很抱歉。 我有一个 position:fixed 标题 div,它有一些图像链接和一个登录 div。由于 position:fixed 是相对于窗口的,每当
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
我正在创建一个模拟证券交易所市场的项目。我在一个大的 html 上向用户公开股票数据其中每个 行有两个 细胞。其中之一是公司的标志(即 AAPL),另一个是当前的市值(再简单不过了)。 我现在所做的
我的 python GAE 应用程序的中央应用程序文件如下所示: import webapp2 import homepage import user_auth import user_confirm
我正在尝试从一堆系统中获取 SSH 横幅。不幸的是,我需要输入密码才能让脚本进入下一个系统。 user@pc:~$ for i in {1..10}; do ssh 192.168.0.$i; don
在我的 spring mvc 3.0 项目中,我有一个充满 .jsp 文件(~150)的目录,我想将其置于 spring 的控制之下。 到目前为止,它们都是由 web.xml 直接调用,而不通过 sp
我正在屏幕上显示一些框。这些是指两种大小的容器。。在移动屏幕上,当屏幕水平宽度太小时,我希望框的大小减小-保持相同的纵横比。我如何才能做到这一点?我不太了解如何使用Flexbox来做到这一点。。。
我是一名优秀的程序员,十分优秀!