简体   繁体   中英

Setting background color in xhtml2pdf

I have a problem with setting background-color using xhtml2pdf library. I want to create specific size element and I do it with success by @frame keyword like this:

@frame r1c1_frame { 
    left: 35pt; width: 262pt; top: 35pt; height: 150pt;
}
@frame r1c2_frame {
    left: 297pt; width: 262pt; top: 35pt; height: 150pt;
}

and if I put -pdf-frame-border: 1; I can see border with specific size. Problem is with the background color for that frame, I can not set color in any way. I set css calss:

.blok {
    font-size: 1.5em;
    color: white;
    background-color: #ac4121;
    text-align: center;
    padding: 5pt;
    display: block;
}

and use it for div tag and no success.

Did You have any similar issue?

Thank You.

尝试在某些元素中使用background: #ac4121代替background-color: #ac4121

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM