HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › uncorrect size for image › Re: Re: uncorrect size for image
I expected you send us at least form_ctact_titre1.jpg. Your HTML/CSS implicitly assumes dimensions of the image, which are not known to me.
@jj_ben wrote:
When i try to generate the html page, the picture of orange bars have not the correct size.
if i add the height of img directly in the css it works :
.formCtactTitre1, .formCtactTitre1Off { width:731px; height:32px; padding:7px 5px 0 30px; font-size:12px; font-weight:bold; color:#FFF; } .formCtactTitre1 { background:url(images/form_ctact_titre1.jpg) no-repeat center;height:40px; margin:5px 0 2px 0 }
With height:40px; you do not scale the image, but increase the DIV height (overriding previous height:32px setting). Obviously form_ctact_titre1.jpg height is about 40px (greater than the initial 32px).
I tried to reproduce the situation, when background image height is less than the box. See attached – PD4ML does not center the background vertically. It is a good question why MS IE does. CSS requires a vertical positioning hint given explicitly:
background:url(images/form_ctact_titre1.jpg) no-repeat center center;
With the CSS change PD4ML positions the background image correctly.
