【发布时间】:2011-12-13 17:10:47
【问题描述】:
好的,所以我完全改变了这个问题,让废话少说。试试这个链接: Printing rotated text crossbrowser(它包含下面给出的源代码)
您将看到带有蓝色边框的红色 blablabla 文本,逆时针旋转 90 度。
现在任何 IE9 用户都有我的问题,请访问我的网站或使用下面的代码。正如您在打印预览中看到的:上下文菜单 -> “打印预览...”,旋转失败! (当然背景颜色会丢失,但这是正常的)
而且我知道可以打印,例如 35 度旋转文本,我有一个例子,但它包含很多垃圾 css 代码,所以我还没有真正弄清楚有什么不同在那个例子中。
谁能看到我在这里遗漏了什么明显的东西?
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
.testRotation
{
width: 200px;
height: 16px;
background-color: red;
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0, M12=1, M21=-1, M22=0, SizingMethod='auto expand');
-moz-transform:rotate(270deg) translate(-200px,0px);
-moz-transform-origin: 0% 0%;
-webkit-transform: rotate(270deg) translate(-200px,0px);
-webkit-transform-origin: 0% 0%;
-o-transform: rotate(270deg) translate(-200px,0px);
-o-transform-origin: 0% 0%;
transform: rotate(270deg) translate(-200px,0px);
transform-origin: 0% 0%;
zoom: 1;
position: absolute;
left: 20px;
top: 100px;
margin: 10px;
}
</style>
</head>
<body>
<div style="position: absolute; width: 16px; height: 200px;left: 25px; top: 105px; background-color: green; border-style: solid; border-width: 5px; border-color: blue;word-wrap: break-word;">
TARGET
</div>
<div class="testRotation">
BLABLABLABLABLA
</div>
</body>
</html>
【问题讨论】:
-
对于 IE9,您可以使用
-ms-transform。 -
我想你错过了我的问题;它是关于实际打印网页。旋转文本不是问题。打印网页时,它不旋转。打印预览和我在弹窗中看到的不一样,可能是我不够清楚?
标签: internet-explorer text printing rotation webpage