doubaoxue5788 2018-08-14 18:23
浏览 198
已采纳

如何删除mpdf中的块元素边距?

I noticed that block elements (ex. div) have some kind of margins by default, and it seems I cannot reset them via css. So how to? does anyone know?

  • 写回答

2条回答 默认 最新

  • dqc2017 2018-08-16 07:16
    关注

    Ok, further investigation took me to the following findings:

    Basically, you cannot use other than really simple/direct selectors. No nested selectors are allowed (like .class p, or ul li), so:

    • think ahead and structure your document in a really simple manner so you don't have to use nested selectors or something more complicated. For example, do not use nested lists (ul li ul)

    • write your css all with ultra simple direct selectors (one element or one class)

    • then you can reset all the margins and paddings of block elements, if/when/where needed.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化