如何在mpdf中居中放置图像?

编程入门 行业动态 更新时间:2024-10-25 12:29:05
本文介绍了如何在mpdf中居中放置图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将图像放在 mpdf (版本6>)中.

I would like to centre image in mpdf (version 6>).

这是我发送给mpdf的(缩短的)html输出. displayed 类没有帮助.

This is my (shortened) html output that I send to mpdf. The displayed class does not help.

<style> IMG.displayed { display: block; margin-left: auto; margin-right: auto } </style> <img style="max-height:600px" class="displayed" src="/images/size_original/m_princezna_1.jpg"/>

推荐答案

在图像的父HTML元素上添加 text-align:center 属性,例如:

Add a text-align: center property on a parent HTML element of the image, eg.:

body { text-align: center }

更多推荐

如何在mpdf中居中放置图像?

本文发布于:2023-10-07 23:49:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470884.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   如何在   mpdf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!