A web developer’s diary

February 7, 2007

Getting rid of the automatic newline after form tag

Filed under: CSS,Html — Celia @ 12:30 pm

Ever had problems in getting rid of the automatic newlines or returnfeed that was inserted after the form tag? I too had the same. Particulary in those places where I needed two forms on the same line.

A little google search helped. HTML forms, like their div counterparts, are block elements. So, they automatically insert newline after their close tag. If you would want to avoid this, you can do so by redefining them as inline elements.

Example:

<form style=”display:inline” >
</form>

Blog at WordPress.com.