If there is a form generated by drupal form api in template file, is there a way how to remove whitespaces between .form-input html elements?

My template looks like this:

            <form action="" method="post" id="activit-grant-filter-form" accept-charset="UTF-8">
                <div class="cont"><!--
             --><?php echo render($form['organisation_type']); ?><!-- 
             --><?php echo render($form['locality']); ?><!--         
             --><?php echo render($form['support_type']); ?><!--     
             --><?php echo render($form['thematic_objective']); ?><!--
                <div class="submit-wrapper">
                    <?php echo render($form['submit']); ?>                       
                    <?php echo drupal_render_children($form); ?>

As you can see I'm using comments between form elements, but they're still keeping whitespaces in between.

  • Why do you render form-api form like that? You should never need to hardcode form tag at all. It's asking for trouble. – Mołot Sep 10 '15 at 13:26
  • Is there a way how to render form tag? I was searching quite a lot but didn't found it. – Incredible Sep 10 '15 at 13:31

Set form font size 0 and increase font size of input

form {
    font-size: 0;

form input {
    font-size: 12px;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.