html - CSS - 在图像顶部旋转文本

标签 html css image-rotation

我有一个客户希望最终用户上传一张图像,在这种情况下,按照下图在日记下面进行 super 拼接。

最终用户可以缩放照片并将其向上/向下和向左/向右移动,他们还可以添加文本(跨度在 div 容器内)

<div id="theText" class="productImageOverlay activeText" style="z-index: 7;font-size:20px;">
    <span class="uploadedImage" id="" style="margin-top: -1px; position: absolute;"></span>
</div>

然后我使用外部包含的左上角作为原点 (0,0) 计算出这些元素的宽度和位置(margin-left,margin-top),并使用 PHP 来创建合成图像正确裁剪。

这工作正常,除了他们现在希望能够旋转我可以使用 CSS 执行的文本(添加 transform: rotate(-90deg); 到跨度),但是,我正在努力如何获得插入点旋转的文本

我知道这一切都可以使用 HTML 5 canvas 元素完成,但它需要与 IE8 配合使用

非常感谢任何帮助

rotated text

最佳答案

尝试在您的 CSS 中使用以下代码作为文本

/* Safari */
-webkit-transform: rotate(-90deg);

/* Firefox */
-moz-transform: rotate(-90deg);

/* IE */
-ms-transform: rotate(-90deg);

/* Opera */
-o-transform: rotate(-90deg);

/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

它应该将文本旋转 90 度,并仍然保持文本的中心点在中心。

关于html - CSS - 在图像顶部旋转文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25480543/

相关文章:

html - 使用 Bootstrap 3 的全宽布局,但带有流体容器

html - 使用 bootstrap 居中对齐内容

javascript - 为什么 fullpage.js 的部分大于窗口?

javascript - 在使用 FileReader 上传之前预览图像,旋转图像

php - 如果php mysql的记录有 'ñ',如何在html中输出?

asp.net - 背景图像不工作

android - 如何获得一个不同 Drawable 的镜像版本的 Drawable?

pdf - 使用 imagemagick 无损旋转 PDF 文件

javascript - Iframe页面自动滚动到中间

html - 将鼠标悬停在提交按钮上 : Am I doing this the best way? 有更好的方法吗?