Float in DOMPDF does not work as it should

Asked

Viewed 297 times

1

I need to use dmpdf to generate a grid of images, but the float does not work properly. Instead of him going down when he gets to the edge of the page he keeps going right. I have tried to put a div up limiting the size but also not solved.

Basically, that’s the code:

.imagem {
    height: 120px;
    float: left;
}
.imagem img {
    height: 100px;
}
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>
<div class="imagem"><img src="http://www.devbattles.com/images/upload/php-elephant.png" /></div>

PS: I have enabled the define("DOMPDF_ENABLE_CSS_FLOAT", true);

  • The pictures are supposed to pile up on top of each other every time the screen gets smaller, is that it? If that’s it, he’s actually already doing it, check here on this example jsFiddle that I created. Decrease the size of the output window to see if that’s what you want to say or do.

  • Actually it is not by reducing the page that the problem occurs. I am generating a pdf of A4 size, and it remains the same size while reducing the screen. But the Ivs already

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.