所以我想打印在纸张的右侧一个div,但是,当我按下Ctrl + P键谷歌浏览器,在打印预览结果,div的右侧在左边。打印一个div在纸
我正在使用bootstrap。我想这
<div class="row">
<div class="col-md-6"></div>
<div id="printMe" class="col-md-6">Print this text on the right</div>
</div>
,但仍当我打印,文本是在纸张的左侧。
所以我想打印在纸张的右侧一个div,但是,当我按下Ctrl + P键谷歌浏览器,在打印预览结果,div的右侧在左边。打印一个div在纸
我正在使用bootstrap。我想这
<div class="row">
<div class="col-md-6"></div>
<div id="printMe" class="col-md-6">Print this text on the right</div>
</div>
,但仍当我打印,文本是在纸张的左侧。
我假设页面的左边部分是空的。试试这个:
<div class="row">
<div id="printMe" class="col-md-6 col-md-offset-6">Print this text on the right</div>
</div>
简单地用右拉式 –
这是有点奇怪,偏移-6不起作用,但当我使用拉右,它的工作原理 – Alvinrightback
你的屏幕分辨率是多少?你必须至少有992px的屏幕宽度才能使'md'工作。 的右拉式的,是它的工作原理,但能够击败响应功能。好吧,这是打印反正。 – harritbal
你的代码更改为:
<div class="row">
<div class="col-md-6 col-md-offset-6"></div>
<div id="printMe" class="col-md-6">Print this text on the right</div>
</div>
感谢您的编辑,我目前在移动,所以我不知道如何正确显示代码 –
我相信你的答案是正确的,但它does not。它只适用于拉右而不是偏移。谢谢你的答案。 – Alvinrightback
它有点离奇,偏移不是在这里工作。
其作品与
<div class="row">
<div class="col-md-6"></div>
<div id="printMe" class="col-md-6 pull-right">Print this text on the right</div>
</div>
谢谢你们BTW。
尝试添加“ ”成空div .. – Rick
添加右拉式类 –
看到@media打印https://www.w3schools.com/css/css3_mediaqueries.asp –