You need to sign in to do that
Don't have an account?
Grrrrrrrrrrrrr
Page Block / Command Button style
I am going crazy.
Here is my VF snippet:
<!-- --------------------------------------- --> <!-- ---------------- UPLOAD --------------- --> <!-- --------------------------------------- --> <div> <apex:form enctype="multipart/form-data"> <apex:pageMessages /> <p>UPLOAD AN ATTACHMENT</p> <apex:pageBlock id="buttons"> <apex:pageBlockButtons > <apex:commandButton styleclass="button1" action="{!upload}" value="Upload Document"/> </apex:pageBlockButtons> </apex:pageBlock> <apex:outputLabel value="File Name" for="fileName"/><apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file"/> <apex:inputText value="{!attachment.name}" id="fileName"/><apex:outputLabel value="File Name" for="file"/> </apex:form> </div> <!-- --------------------------------------- --> <!-- ------------ END UPLOAD --------------- --> <!-- --------------------------------------- -->
Here is my VF view:
It looks so painfully ugly. I know. I have tried everything I can think of in my styles.
Here are some that have yielded poor results:
.pbHeader {clear:both!important; text-align: left!important; background-color: #FFFFFF!important;} .pbTitle {width: 50%!important} .bPageBlock {background-color:#FFFFFF!important; clear:both!important; text-align:left!important; padding: 0px!important; margin: 0px!important; } .button1 {background-color:#FFFFFF; clear:both!important; text-align:left!important; padding: 0px!important; margin: 0px!important; }
What I am looking to do is to justify left my page buttons block of code. But I can't seem to get down to the heart of css code.
Any thoughts?
I found the answer I needed by opening up chrome and firefox's developer tools that allow me to see the CSS names that have been given by Salesforce. I was then able to alter the css by overriding theirs.
Although I do like Firefox, I was impressed by Chrome's csscan ... it really picked in and gave me what I needed.
All Answers
Hi
Add style="align:left;" in apex:pageBlockButtons tag like below.
Hi Shiva,
Thank you for the suggestion. I have tried that before, and just now I tried it again, and it is not working. There has to be something inside the Salesforce CSS that is overriding whatever styles I name.
I even used firebug to open up the CSS and find it there. Here is the code exposed w/ firebug. Even using these, I am still at a loss as to how I can override Salesforce's code.
Is there anyway that I can force it to not put their code into a table? Or, make it conform to a strict box model that i wrap around their pageBlock code?
I found the answer I needed by opening up chrome and firefox's developer tools that allow me to see the CSS names that have been given by Salesforce. I was then able to alter the css by overriding theirs.
Although I do like Firefox, I was impressed by Chrome's csscan ... it really picked in and gave me what I needed.