marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

Flex is not Wroking #592

Open hishamabutt opened 4 years ago

hishamabutt commented 4 years ago

I am using Flex for styling the html but it is not working in the pdf.

biztrology-kd commented 3 years ago

add this css
display: -webkit-box; display: -webkit-flex; -webkit-flex-wrap: wrap; display: flex; flex-wrap: wrap;

add this in package.json

       "browserslist": [
"Safari >=4"

]

madhavkaneriya commented 3 years ago

I found this answer from StackOverflow very helpful, just add -webkit prefix to all your flex properties. I tried it out and it worked perfectly for me!

display: -webkit-flex; -webkit-flex-direction: row; -webkit-flex: 1;

ELBEQQAL94 commented 3 years ago

You can use float instead of flexbox or grid.

arnaudambro commented 3 years ago

already answered https://github.com/marcbachmann/node-html-pdf/issues/419

Vatsal-24 commented 2 years ago

Thank you @rongliangduan @madhavkaneriya!!! Wasted 2 days :(

MostafaHamdy3 commented 11 months ago

I'm using the grid but it is not working in the pdf also.