This is a title In the css, the "table-title" goes like this: .tab" /> This is a title In the css, the "table-title" goes like this: .tab" /> This is a title In the css, the "table-title" goes like this: .tab"/>

Can't get "background-color" property from item using printThis library

30 views Asked by At

I'm using the printThis library to print some stuff.

<div class="table-title">This is a title</div>

In the css, the "table-title" goes like this:

.table-title {
 color: white;
 padding: 7px 7px;
 font-size: 1em;
 background-color: #88B1C0;
 display: block;
 text-align: center;
 margin-bottom: 20px;
 margin-top: 9px;
 height: 63px;
 line-height: 1.5em;
}

In my code im calling the printThis function loading also another css file where I'm introducing some modifications.

In this file I had at the beginning this to actually see the space the element was taken

.table-title {
    border: 2px solid black;
}

I then realized that the element had no background-color and also, the color of the text was black.

So I did a few changes:

    .table-title {
    border: 2px solid black;
    color: white !important;
    background-color: blue !important;
}

Now the text is white (notice I had to add the !important), but it doesn't matter how I try to set up the color of the background, it is always white (the default).

I'm calling the printThis function only with the attribute "loadCSS". By deafult, it should copy the <style> tags to the iframe, but It looks like it's not doing so.

This is what I see on the website (ignore the content, it is not relevant):

table on website

And this is what I see on the iframe from printThis:

table on iframe

Again, the only options I'm using with printThis is importCSS. By default It should use the CSS and the style tags that the page already contains.

Is there something I can do? Is the library just not working properly? Am I missing something here?

0

There are 0 answers