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>

Advertisements

4 Comments »

  1. This is cool!
    I used to stuff the tags around the tags so that they have no room for newlines!

    Comment by Walmik — March 20, 2007 @ 7:45 pm | Reply

  2. Woah! This wont take tags?
    I used to stuff the form tags around the td or tr tags so that they have no room for newlines!

    Comment by Walmik — March 20, 2007 @ 7:46 pm | Reply

  3. @Walmik – How about using form tags with divs then?

    Yeah, I also used to do the same with td and trs.. I have got rid of them now šŸ˜€

    Comment by Bindu — March 21, 2007 @ 6:44 am | Reply

  4. Nice! Been looking for solution of this for days.
    Thank you šŸ™‚

    Comment by SoFresh — December 3, 2009 @ 12:28 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: