0

I am trying to apply a style in the <apex:outputText> but it doesn't work. Below is the code:

<apex:outputText  value="Please refer this link for more information <a href =https://www.w3schools.com/>https://www.w3schools.com</a>"/>

So now i wanted to give some css touch to the above hyperlink by changing the

<apex:outputText  value="Please refer this link for more information <a style=color:antiquewhite;text-decoration:underline;padding:42px; href =https://www.w3schools.com/>https://www.w3schools.com</a>"/>

etc... but when i try to put the style in the tag it is not working. Can anyone help me on this.

Thanks

0

You don't have quotation marks around your style definition. And additionally there was another couple of issues in your example (text as attribute etc)

  <apex:outputText value="Please refer this link for more information"> 
  <a style="color:antiquewhite;text-decoration:underline;padding:42px;" href ="https://www.w3schools.com/">https://www.w3schools.com</a>
  </apex:outputText>
| improve this answer | |
0

You can resolve that issue using apex:outputLabel and apex:outputLink. Try below code it will work.

<apex:pageBlock>
        <apex:pageBlockSection>
            <apex:pageBlockSectionItem>
                <apex:outputLabel value="Please refer this link for more information ">
                <apex:outputLink value="https://www.w3schools.com">https://www.w3schools.com</apex:outputLink>
                    </apex:outputLabel>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.