function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sylvie Serplet 1Sylvie Serplet 1 

Backgroung-image in css style does not display in a table header

Hi,

I try to display an image in my table header and could not figure it out how. I have read a lot of forum and tried different solutions but nothing works in my case.
By defining a CSS style I could make all the other components work except the image. When I add ! important the image displays but does not take into account the not repeat, so the image is all over the column header on top of the text. This is a part of my code. Any help will be much appreciated.
<style type="text/css"> 
        .headerRow {
                background-image: url("{!$Resource.bgimage}");
                background-repeat: no-repeat;
                background-position: right;    
                font-size: small; 
                height: 20px; 
                text-align: center; 
                cursor: pointer;
        } 
     </style>

 <apex:pageBlockTable value="{!Events}" var="Event" id="EventTable" columnsWidth="2%,35%,35%,10%,10%,8%" styleclass="tablesorter"> 

<apex:column headerValue="Description" headerClass="headerRow" value="{!Event.Description}"/>  

....

</apex:pageBlockTable>

Thank you.
 
Best Answer chosen by Sylvie Serplet 1
pconpcon
The reason it is not working as expected (and works with the !important) is that your selector is not specific enough.  You can either make your CSS have a more sepcific selector, or add !important to all parts of your .headerRow CSS

All Answers

pconpcon
The reason it is not working as expected (and works with the !important) is that your selector is not specific enough.  You can either make your CSS have a more sepcific selector, or add !important to all parts of your .headerRow CSS
This was selected as the best answer
Sylvie Serplet 1Sylvie Serplet 1
Thank you so much. It works now. I have added ! important to my 3 background elements.
pconpcon
Great! If you don't mind marking the best answer to this question to help people in the future as well as to remove this from the un-answered queue.
Sylvie Serplet 1Sylvie Serplet 1
Hello, I would like to do it but I could not figure it out how. Sorry. If you can help? Best Regards, [cid:image001.png@01D0C5EC.7BF175C0]
pconpcon
After logging in, if you hover over the answer you you want to mark as best a "best answer" link will show up.  Click that.

Best answer link