Skip to main content
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
1 respuesta
  1. 6 sept 2016, 16:00
    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;

    }

    </style>

    <apex:form >

    <apex:outputLabel><span class="my-class">Hello</span> World!</apex:outputLabel>

    </apex:form>

    </apex:page>

    Regards.

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

     
0/9000