Horizontal form elements I have described the form, but every element there is located under the previous one. I need to describe the form where all elements will be placed horizontally but not vertically.
This is my form:

function contact_register_form($form, &amp;$form_state) {
  $form['description'] = array(
    '#type' =&gt; 'item',
    '#title' =&gt; t('Sign up to be notified when your community launches:'),
  );

  $form['email'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Email'),
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Add me',
  );    

  return $form;
}
You can use code similar to the following one, used by the Node module in node_filter_form().

  // Build the 'Update options' form.
  $form['options'] = array(
    '#type' =&gt; 'fieldset', 
    '#title' =&gt; t('Update options'), 
    '#attributes' =&gt; array('class' =&gt; array('container-inline')), 
    '#access' =&gt; $admin_access,
  );

  // ...

  $form['options']['operation'] = array(
    '#type' =&gt; 'select', 
    '#title' =&gt; t('Operation'), 
    '#title_display' =&gt; 'invisible', 
    '#options' =&gt; $options, 
    '#default_value' =&gt; 'approve',
  );


The key is the line settings the "#attributes" attribute to "container-inline."

That code is for Drupal 7; the equivalent code for Drupal 6 starts with the following code:

  $form['options'] = array(
    '#type' =&gt; 'fieldset', 
    '#title' =&gt; t('Update options'), 
    '#prefix' =&gt; '&lt;div class="container-inline"&gt;', 
    '#suffix' =&gt; '&lt;/div&gt;',
  );


Supposing you are using Drupal 6, then your code should be changed to something similar to the following one:

function contact_register_form($form, &amp;$form_state) {
  $form['description'] = array(
    '#type' =&gt; 'item',
    '#title' =&gt; t('Sign up to be notified when your community launches:'),
  );

  $form['email'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Email'),
    '#prefix' =&gt; '&lt;div class="container-inline"&gt;', 
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Add me',
    '#suffix' =&gt; '&lt;/div&gt;',
  );    

  return $form;
}


I didn't put the description inline, as it would not be correctly rendered because it is using a "item" form field. I also find that inlining the description would cause the form to take too much space. (Imagine what would happen if the inlined description would be longer, and placed in a single line.)

The CSS styles that Drupal 7 adds to container-inline elements are the following.

/**
 * Inline items.
 */
.container-inline div,
.container-inline label {
  display: inline;
}
/* Fieldset contents always need to be rendered as block. */
.container-inline .fieldset-wrapper {
  display: block;
}


They are added from system.base.css.