Search This Blog

Oct 24, 2011

Removing auto Break tags from Form inserted by Wordpress

I love Wordpress, there’s no doubt on that. Being the best platform for making sites (either it is blogging / brand site) through easy content management, thousands of free plugins and themes, helpful support and forums.

 However, it mess some HTML code that entered on its post sometimes. One problem that I always seen is the <br/> tags inside the FORM element. Wordpress is automatically generating a BR tag and insert it before field in a form.

 Due to unwanted BR tags there could be issues on the layout in your form. So, to make the layout fix, simply create a class and make a add “display none” in your stylesheet.
Ex. If you have a form 
 <form class=”remove-br”>

 // all input fields code are here. Including BR tags generated by wordpress

</form>
In your stylesheet:
.remove-br br{display:none;}
Pretty simple, isn’t it? :)