Example of a HelloWorld VF page:

<apex:page sidebar="false" showHeader="false">
    <h1>Hello World!</h1>
</apex:page>

Another example with some subcomponents:

<apex:page sidebar="false" showHeader="false">
    <h1>Hello World!</h1>
		// page blocks separate the page
    <apex:pageBlock title="A Block Title">
				// page block sections are collapsable
        <apex:pageBlockSection title="A Section Title">
            I'm three comps deep!
        </apex:pageBlockSection>
        <apex:pageBlockSection title="A New Section">
            This is another section.
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

Global Variables

Use global variables to access and display system values and resources in your Visualforce markup.

For example, Visualforce provides information about the logged-in user in a global variable called $User . You can access fields of the $User global variable (and any others) using an expression of the following form: {! $GlobalName.fieldName } .

<apex:page>
    
    <apex:pageBlock title="User Status">
        <apex:pageBlockSection columns="1">
            
            {! $User.FirstName } {! $User.LastName } 
           ({! $User.Username })
            
        </apex:pageBlockSection>
    </apex:pageBlock>
    
</apex:page>

The {! ... } tells Visualforce that whatever is within the braces is dynamic and written in the expression language. Its value is calculated and substituted at run time, when someone views the page.

Visualforce expressions are case-insensitive, and spaces within the {! ... } are ignored. So these expressions all produce the same value:

There are many global variables and functions that you can use in Visualforce expressions.

There are nearly two dozen global variables that can be used within Visualforce. They’re useful for getting information about the currently logged in user, as you saw, but also for getting details about the organization ($Organization ), settings ($Setup ), details about custom objects ($ObjectType ), actions available on those objects ($Action ), and so on. See the Visualforce global variables reference to dive in.

Formula Expressions

Visualforce lets you use more than just global variables in the expression language. It also supports formulas that let you manipulate values.