function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tizian KirchmannTizian Kirchmann 

Styling in Visualforce

Hi everyone,

I created a visualforce page for our company.

There is e.g. this code snippet:
 
<apex:outputText value="Gesamtzeit" style="{!if(Rapport__c.Beginn2__c == NULL,'margin-top: 17px;','')}"/>

I want to achieve that the text value ("Gesamtzeit") gets moved downwards by 17px when the field value of field Beginn2__c is NULL and stay at the same place (do nothing) when its NOT NULL.

Somehow it doesnt do anything when I check the result even though there is no error or anything.

Am I doing anything wrong?

Thanks
Tizian
 
Raj VakatiRaj Vakati
try this
 
<apex:outputText value="Gesamtzeit" style="{!if(opp.StageName!='','', 'margin-top: 17px')}"/>