• Glen Swindell
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Following the instructions on http://www.salesforce.com/us/developer/docs/pages/Content/pages_styling_custom.htm, I have created a style sheet file that contains the following

<style type="text/css">
    .required { font-weight: bold;}
</style>

I then uploaded it as a static resource called tntStyle.


Then in use, I have a visualforce page that includes the style sheet - thus

<apex:page showHeader="false" id="page" sidebar="false" standardController="Feedback__c" action="{!defaultValues}" extensions="FeedbackReturnPageExt" standardStylesheets="false">

<apex:stylesheet value="{!$Resource.tntStyle}"/>

<apex:pagemessages />
    <apex:form id="form">
        <apex:pageBlock mode="maindetail" >

            <apex:pageBlockButtons location="bottom">
                <apex:commandButton action="{!save}" value="Submit" />
               
            </apex:pageBlockButtons>

<apex:pageBlockSection columns="1">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="title">title</apex:outputLabel>
                    <apex:inputText id="title" value="{!Feedback__c.Title__c}" />
                </apex:pageBlockSectionItem>
                <apex:inputField value="{!Feedback__c.First_Name__c}" />
                <apex:inputField value="{!Feedback__c.Last_Name__c}" />            
                <apex:pageBlockSectionItem >
                    <apex:outputLabel styleclass="required" for="cor">Country of Residence</apex:outputLabel>
                    <apex:inputText id="cor" required="true" value="{!Feedback__c.Country_of_Residence__c}" />
                </apex:pageBlockSectionItem>                    
                <apex:inputField value="{!Feedback__c.Email__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="emailToCheck">Email verification</apex:outputLabel>
                    <apex:inputText id="emailToCheck" value="{!EmailToCheck}" />
                </apex:pageBlockSectionItem>
               
                <apex:inputField value="{!Feedback__c.Phone__c}" />
                <apex:inputField value="{!Feedback__c.Subject__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel styleclass="required" for="CustomerComments">Comments</apex:outputLabel>
                    <apex:inputField id="CustomerComments" required="true" value="{!Feedback__c.Customer_Comments__c}" />
                </apex:pageBlockSectionItem>
                <apex:inputField value="{!Feedback__c.Customer_Entered_Account_Number__c}"/>
                <apex:inputField value="{!Feedback__c.Consignment_Number__c}" />
                                                 
        </apex:pageBlockSection>
        </apex:pageBlock>



    </apex:form>
</apex:page>

It does not however seem to change the font of the text to bold, whereas if I include the style "inline" within the page, it does.

Is there some stage I am missing to get this working with a CSS file. 

 

Many thanks

Following the instructions on http://www.salesforce.com/us/developer/docs/pages/Content/pages_styling_custom.htm, I have created a style sheet file that contains the following

<style type="text/css">
    .required { font-weight: bold;}
</style>

I then uploaded it as a static resource called tntStyle.


Then in use, I have a visualforce page that includes the style sheet - thus

<apex:page showHeader="false" id="page" sidebar="false" standardController="Feedback__c" action="{!defaultValues}" extensions="FeedbackReturnPageExt" standardStylesheets="false">

<apex:stylesheet value="{!$Resource.tntStyle}"/>

<apex:pagemessages />
    <apex:form id="form">
        <apex:pageBlock mode="maindetail" >

            <apex:pageBlockButtons location="bottom">
                <apex:commandButton action="{!save}" value="Submit" />
               
            </apex:pageBlockButtons>

<apex:pageBlockSection columns="1">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="title">title</apex:outputLabel>
                    <apex:inputText id="title" value="{!Feedback__c.Title__c}" />
                </apex:pageBlockSectionItem>
                <apex:inputField value="{!Feedback__c.First_Name__c}" />
                <apex:inputField value="{!Feedback__c.Last_Name__c}" />            
                <apex:pageBlockSectionItem >
                    <apex:outputLabel styleclass="required" for="cor">Country of Residence</apex:outputLabel>
                    <apex:inputText id="cor" required="true" value="{!Feedback__c.Country_of_Residence__c}" />
                </apex:pageBlockSectionItem>                    
                <apex:inputField value="{!Feedback__c.Email__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="emailToCheck">Email verification</apex:outputLabel>
                    <apex:inputText id="emailToCheck" value="{!EmailToCheck}" />
                </apex:pageBlockSectionItem>
               
                <apex:inputField value="{!Feedback__c.Phone__c}" />
                <apex:inputField value="{!Feedback__c.Subject__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputLabel styleclass="required" for="CustomerComments">Comments</apex:outputLabel>
                    <apex:inputField id="CustomerComments" required="true" value="{!Feedback__c.Customer_Comments__c}" />
                </apex:pageBlockSectionItem>
                <apex:inputField value="{!Feedback__c.Customer_Entered_Account_Number__c}"/>
                <apex:inputField value="{!Feedback__c.Consignment_Number__c}" />
                                                 
        </apex:pageBlockSection>
        </apex:pageBlock>



    </apex:form>
</apex:page>

It does not however seem to change the font of the text to bold, whereas if I include the style "inline" within the page, it does.

Is there some stage I am missing to get this working with a CSS file. 

 

Many thanks