+ Start a Discussion

how to give a colour to field on every field in visual forcepage?

Jia HuJia Hu
Use standard Html Tab, such as Table, Tr, Td to define the format of your data on Visualforce page.

Then you can set the color of fields like HTML page.
Also you can use a CSS file to define the style of the whole page.

Suresh RaghuramSuresh Raghuram

try adding this to your field


<apex:outputpanel style="color: red"></apex:outputpanel>
if this answers your question make this as solution

this is my code pls tell me how to give colour to name field box




<apex:page sidebar="false" standardController="student__c" extensions="student">
<apex:relatedList list="courses" />

<apex:relatedList list="students">
<apex:facet name="header">Titles can be overriden with facets</apex:facet>
<apex:image id="theImage" value="{!$Resource.tulips}" width="100" height="30"/>
<apex:sectionHeader description="student Edit" title="New student" help="http://www.google.co.in/" />

<apex:pageBlock >,<apex:form >


<apex:commandbutton value="save" action="{!save}"/>
<apex:commandButton value="save&new"/>
<apex:commandButton value="cancel"/>
</apex:form><b><b><b><b><b><b><apex:tabPanel >

<apex:tab label="home" onclick="home"><apex:form >

<apex:outputText >name</apex:outputText>
<apex:inputText value="{!name}"/><br/>
<apex:tab label="Two">content for tab two</apex:tab>

<apex:pageBlock >,<apex:form >

<apex:commandButton value="save" action="{!save}"/>
<apex:commandButton value="save&new"/>
<apex:commandButton value="cancel"/>
background-color:white !important;
background-image:none !important;
color:black !important;
font-style:italic !important;