2017-04-12 49 views
0

這裏是我的CSS代碼:Laravel 5背景圖像不顯示在DOMPDF上?

#header { 
    background-image: url(../assets_frontend/images/pinpdfheader.jpg); 
    width: 100%; 
    background-repeat: no-repeat; 
    background-size:contain; 
    height:150px; 
} 

我嘗試我的html文件轉換成DOMPDF但不知何故,我的背景圖片沒有顯示出來,如何在DOMPDF使用背景圖片網址?

+1

http://stackoverflow.com/questions/11360603/dompdf-not-displaying-image-generated-by-php-file –

回答

0
.img-container { 
    height:148px; 
    width: 148px; 
    border: 2px solid #59d; 
    border-spacing: 0; 
    text-align: center; 
} 
.img-container img { 
    display: inline-block; 
    vertical-align: middle; 
    max-width: 148px; 
    max-height: 148px; 
    background-size: contain; 
} 

<table class="img-container"><tr><td> 
    <img src="image_path.jpg"> 
</td></tr></table>