Home  >  Article  >  Web Front-end  >  html布局问题_html/css_WEB-ITnose

html布局问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:02:541454browse


我在页面做出这个效果,但是用打印机打印出来的效果确实二维码在文字下面,请问各位大神这该怎么改,
页面代码如下:

<input name="b_print" type="button" class="ipt"  onClick="printdiv('cardstyle');" value="打印 "><div id="div_print"><div id="cardstyle" >										<div id="address" class="divbox" >											<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Production Date: 10/30/2015 </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Naterial Code  : 20401100000 </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Parts Name  : Coil </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Model Name: KK04 </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;"> Qty : 2000Pcs </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Supplier Code : 123456789 </h3>						<h3 style="border:none;border-bottom:black solid 1px;font-size:10px;width:150px;">Lot No : 2015-001 </h3> 											</div>					<div id="map" >						<img alt="Sample map" src="X220003200.jpg" width="120"    style="max-width:90%" />					</div>				</div>  


回复讨论(解决方案)

 

 float:right ?或者绝对定位下。

 

 float:right ?或者绝对定位下。
是这样改嘛?

你说的定位是 怎么定位?

position:absolute;

样式如下,具体你再修改一下:

<style>#cardstyle{position:relative;}#cardstyle .divbox{position:absolute;left:10px;}#cardstyle #map{position:absolute;left:300px;top:60px;}</style>

看着比较麻烦

position:absolute;



你说的两种方法都试过了,都不行,float:right 这一种打印出来的结果跟我之前的一样,
这种打印出来的二维码跟文字距离相差太远

样式如下,具体你再修改一下:

<style>#cardstyle{position:relative;}#cardstyle .divbox{position:absolute;left:10px;}#cardstyle #map{position:absolute;left:300px;top:60px;}</style>

你说的这种方法打印出来的结果也是一样的,没变化。

各位大神帮帮忙啊

打印机上的排版跟浏览器的不一样的吧,往这方面看一下吧

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn