Adding custom Text changes the horizontal alignment in Content type I have a content type. For two fields I am using horizontal tab item . those two fields Section_grid_image and section_grid_image_path are displayed one after another so I have used hook_form_alter and added custom CSS.

function displayor_form_alter(&amp;$form, &amp;$form_state, $form_id) {

//Load CSS 
$form['#attached']['css'][drupal_get_path('module', 'displayor') . '/form.css'] = array();


if ($form['#id'] == 'section-node-form'){ //contenttype-node-form

   $form['field_section_grid_image']['#prefix'] = '&lt;div id="leftcolumn"&gt;';
   $form['field_section_grid_image']['#suffix'] = '&lt;/div&gt;';
   //where field_test is your file upload field


   $form['field_section_grid_image_path']['#prefix'] = '&lt;div id="rightcolumn"&gt; OR';
   $form['field_section_grid_image_path']['#suffix'] = '&lt;/div&gt;';
   //where field_test is your file upload field
 }
}


CSS 

#leftcolumn{
width: 400px;  
float: left;
}

#rightcolumn{
 width: 600px;
 margin-left: 200px;
}

#innercolumn{
 width: 500px;
}


My alignment is getting like this:


I want the fields and OR to be displayed in a line.

How to do this.

EDIT: Got the answer.Below CSS did the trick.

function displayor_form_alter(&amp;$form, &amp;$form_state, $form_id) {

//Load CSS 
$form['#attached']['css'][drupal_get_path('module', 'displayor') . '/form.css'] = array();


if ($form['#id'] == 'section-node-form'){ //contenttype-node-form

   $form['field_section_grid_image']['#prefix'] = '&lt;div id="leftcolumn"&gt;';
   $form['field_section_grid_image']['#suffix'] = '&lt;/div&gt;';
   //where field_test is your file upload field


   $form['field_section_grid_image_path']['#prefix'] = '&lt;div id="rightcolumn"&gt;&lt;span class="or"&gt;(OR)&lt;/span&gt;';
   $form['field_section_grid_image_path']['#suffix'] = '&lt;/div&gt;';
   //where field_test is your file upload field
 }
}


CSS 

#leftcolumn, 
#rightcolumn,
#orseperator
 {
   float: left;
   margin-right: 77px;
   padding: 10px;
 }
 .or
  { left: 382px;
   margin-right: 25px;
   margin-top: 1px;
   position: absolute;
   top: 76px;
  }
Why dont you just do the following:

   $form['field_section_grid_image']['#suffix'] = '&lt;/div&gt;&lt;div&gt; OR';

   $form['field_section_grid_image_path']['#prefix'] = '&lt;/div&gt;&lt;div id="rightcolumn"&gt;';