Adding 's on the user login page The following code is adding &lt;div&gt;'s and link to the form action. How can I add them before the form?

function ajax_register_form_user_login_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['bigletters'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; 'Big letters',
  );

  $form['smallletters'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; 'Small letters',
  );

  $form['links'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; '&lt;a href="http://example.com"&gt;&lt;/a&gt;',      
  );
}
If you need the form elements you are adding to appear before the other ones, you should use the #weight property, and give them a negative value, since the default value is zero. Differently, the form elements you add to a form via hook_form_alter() are normally appended to the form, with the exception of when there is a form element with a positive #weight value higher than the #weight value you assigned to your form element.

user_login() doesn't set the weight of its form elements. The following code should work.

function ajax_register_form_user_login_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['bigletters'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; 'Big letters',
    '#weight' =&gt; -10,
  );

  $form['smallletters'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; 'Small letters',
    '#weight' =&gt; -8,
  );

  $form['links'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; '&lt;a href="http://example.com"&gt;&lt;/a&gt;',      
    '#weight' =&gt; -6,
  );
}


If the code doesn't work, then there is probably another module that alters the weight of the other form elements.