node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Flex is not Wroking

Open hishamabutt opened this issue 4 years ago • 6 comments

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

hishamabutt avatar Sep 12 '20 12:09 hishamabutt

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"

]

kd-biztrology avatar Sep 19 '20 00:09 kd-biztrology

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;

madhavkaneriya avatar Jan 05 '21 12:01 madhavkaneriya

You can use float instead of flexbox or grid.

ELBEQQAL94 avatar Jan 23 '21 17:01 ELBEQQAL94

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

arnaudambro avatar Feb 03 '21 16:02 arnaudambro

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

Vatsal-24 avatar May 11 '22 10:05 Vatsal-24

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

MostafaHamdy3 avatar Oct 13 '23 04:10 MostafaHamdy3