vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

CSS float seems to be ignored

Open bluesillybeard opened this issue 2 years ago • 1 comments

I use embedded HTML and CSS to create a layout of my elements. Vscode's preview renders it fine, and when exported to HTML the markdown renders fine in a browser. However, the PDF export does not render correctly.

Here is my markdown

<!-- Main div for the layout -->
<div style="border-top:solid">
<!-- Div for left side -->
<div style="float:left;">

#### This only exists

### For testing

</div>

<!-- Div for right side -->
<div>
<div style="float:right;padding:5pt">

### More

### Testing

</div>
<!-- Div for center line-->
<div style="float:right;height:100vh;border-left:solid;padding:5pt"></div>
</div>
</div>

Which should look like this screenshot: image

But it ends up looking like this instead: image

It looks the same as if all of float css attributes were removed.

bluesillybeard avatar Jan 30 '24 01:01 bluesillybeard

Workaround: export as HTML, load the file into a browser, and use the print function to create a PDF file. I believe most browsers should have a print function, but for Firefox it's in the hamburger menu on the right.

bluesillybeard avatar Jan 30 '24 02:01 bluesillybeard