background-image renders on top of other content
See original GitHub issueI use a background-image on the @page
. In the past this has worked fine, but as of xhtml2pdf 0.2.7, the image now renders on top of all the other content, and because my image is fully opaque, that means none of the content is visible.
For what it’s worth, I think that a CSS property named “background-image” should render the image in … well, in the background 😃
Reverting to 0.2.6 solves the problem for me.
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top Results From Across the Web
css - Elevate background image over content - Stack Overflow
The background-image property of css is used to put an image at the background of an element. To put an image in the...
Read more >background-position - CSS: Cascading Style Sheets | MDN
The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set ...
Read more >Mastering CSS image overlay | A Practical Guide - ImageKit.io
Image overlay effects using CSS. Just like we added text on top of images, we can also add images over other images using...
Read more >How to Position One Image on Top of Another in HTML/CSS
Sometimes, you may need to place one image over another one. It can be easily done with HTML and CSS. See how to...
Read more >CSS background-position property - W3Schools
The background-position property sets the starting position of a background image. Tip: By default, a background-image is placed at the top-left corner of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi
I have achieved a solution by editing default.py from xhtml2pdf.
Background of Problem: Parser.py use’s `def getColor(value, default=None):
` method in xhtml2pdf which is resided in util.py, has a condition, that if user set background-color: transparent; than simply replace background color with #ffffff(white Background Color). as p element by default doesn’t support background-color property in xhtml2pdf. so while parsing CSS p element inherits default HTML attributes where default background-color property is set to transparent. which invokes if statement in parser.py via util.py & changes it background to white.
i have already removed it.
I added many custom attributes in default.py and these are working fine and also added a card size page of 86mm x 54mm by editing reportlab, so you can do customization just keep track of then to redo changes in case of error.
Have a good day.
related to https://github.com/xhtml2pdf/xhtml2pdf/issues/605