DIV fixed size with CSS (generate PDF with MPDF)

0

I need a DIV with fixed size in centimeters width:12.5cm; and height:7.5cm; . I can maintain these sizes when loading the view, but when I generate the PDF using PHP's mPDF class, it ignores height and increases it according to content. I need that regardless of the content, the size is maintained, even if the content goes over the edges.

CSS that I'm using in the DIV:

.container-ficha {
        background-color:#ffffff;
        width:12.5cm;
        height:7.5cm;
        border:1px solid black;
        margin: 0 auto 0 auto;
    }

L

    
asked by anonymous 27.12.2018 / 13:49

2 answers

0

CSS works in the form of cascades, that is, by hierarchies.

try to use the !important code in its properties that should not be overwritten.

example:

 .container-ficha {
            background-color:#ffffff;
            width:12.5cm !important;
            height:7.5cm !important;
            border:1px solid black;
            margin: 0 auto 0 auto;
        }
    
27.12.2018 / 14:19
0

The solution I found was to add position:fixed; to class .container-ficha . Doing this he obeyed width and height .

    
27.12.2018 / 16:56