i have a visualforce page where i need to display some rich text fields, and i found some CSS that makes the font resize based on the display widht of the device. This works perfectly with a normal text, but once i use the tag <apex:outputText this doesn't work anymore. Do you guys know how to apply it to apex:outputtext?

For me it would be ok to have another tag that lets me show rich text and apply CSS to it, not necessarily apex:outputtext, but it seems to be the only one who works with rich text fields.

<apex:page standardController="Account" showHeader="false" sidebar="false" >
        <apex:slds /> 
font-size: calc(3vw + 3vh);

<div class="resizeme">
    viewBox="0 0 500 75"
    preserveAspectRatio="xMinYMid meet"
        ><apex:outputText escape="false" value="{!Account.Text__c}"  ></apex:outputText></text>


Edit : As you see here on the iPad version the text with the red border is as i want, taking the whole widht and using the CSS. The text below instead is using the apexoutput tag and it's resizing and wrapping between the 2 pictures, the second one is the phone view. enter image description here enter image description here

  • one way to debug this is to look at the generated HTML for each experiment to give you a clue.
    – cropredy
    Feb 4, 2022 at 4:29
  • Ok i uploaded now 2 pictures to explain it better.
    – Brian23Gt
    Feb 4, 2022 at 7:01
  • Post the HTML markup please
    – cropredy
    Feb 4, 2022 at 17:57
  • I'm miscommunicating somehow -- generated HTML, not the VF markup for both the working and not working use cases; you'll need to use browser developer tools to get the markup.
    – cropredy
    Feb 4, 2022 at 20:20
  • Ok which html exactly? because the ones i found in the developer tool are super long.
    – Brian23Gt
    Feb 4, 2022 at 23:26

1 Answer 1


I Made it work in the end by using the tag : apex:outputField But this works only if you want to print a field value, not a string.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .