+ Start a Discussion

formatting text in output label

Hi folks,
  I am using outputLabel to display some text in my visualforce page. But I wanted to format only a part of the text and make it bold or change its color. I tried using CSS but it formats the everthing inside outputLabel. How can I only format a portion of it?

Thank you
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello prati@salesforce,

Try using a span tag inside your label. Please, refer to the code below:
<apex:page standardController="Account">
    <style type="text/css">
        .my-class {
        font-weight: bolder;
    <apex:form >
        <apex:outputLabel><span class="my-class">Hello</span> World!</apex:outputLabel>  


Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.