Kozea / Kozea/WeasyPrint

display: inline-block not working for text + image div

Open
#656 6 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
9.6k
Forks
876
Avg merge
3d 18h
Merged PRs (30d)
5

Description

Hi everyone,

I have an html block that looks like this:

```


LOREM IPSUM




```

When I style child1 and child2 with display: inline-block in a separate stylesheet, the text and image are properly side by side when I open up the HTML in the browser. However, with the pdf output from weasyprint, the text and image are vertically arranged (even though the image is small enough to allow for horizontal arrangement).

This doesn't happen when my child2 is another block of text or a table. I have also tried styling the image with display: inline-block to no avail. This seems like a bug to me, given that it shows up properly on browser, but I would like to make sure I'm not misunderstanding something about weasyprint. Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the HTML example and its inline-block stylesheet, then reproduce the difference between browser layout and WeasyPrint PDF output. Compare the image-containing case with the text and table cases described in the issue. Done means the two child divs render side by side when the available width is sufficient, without changing the other cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html, python
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.