By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,544 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,544 IT Pros & Developers. It's quick & easy.

<form> without <p> break

P: n/a
HTMListas:

(Apologies for I can't Google for this - too many common words.)

I have a <form> tag.

It thinks I want a <p> break before and after the form. I don't. (My forms
are sneaky and inline.)

How do I avoid paragraph breaks around a <form> tag?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Phlip wrote:
How do I avoid paragraph breaks around a <form> tag?


If you're referring to margins when you say "paragraph breaks", use this:

form {
margin : 0;
padding : 0;
}
Jul 23 '05 #2

P: n/a
On Sun, 07 Nov 2004 19:44:29 GMT, Phlip <ph*******@yahoo.com> wrote:
HTMListas:

(Apologies for I can't Google for this - too many common words.)

I have a <form> tag.

It thinks I want a <p> break before and after the form. I don't. (My
forms
are sneaky and inline.)

How do I avoid paragraph breaks around a <form> tag?


The break you see is not really a <p> break, though it is related.

Some block elements (the ones which aren't inline, or which don't occur in
the flow of the text but stand alone) have marging and/or padding which
make other elements have to be a distance away from them when rendered on
screen.

p and form are two such elements. So what you need is to use CSS to
eliminate the margin on the form. Possibly, a neighboring element will
also have a margin, though, so you might have to adjust it too.
Jul 23 '05 #3

P: n/a
Leif K-Brooks wrote:
Phlip wrote:

How do I avoid paragraph breaks around a <form> tag?


If you're referring to margins when you say "paragraph breaks", use this:

form {
margin : 0;
padding : 0;
}


Okay, that leads to this:

yo:<form style="margin:0;padding:0"><input type="edit"></form>

That's giving me this:

yo:
[ ]

Without the 0 padding stuff, there would be the moral equivalent of a <p/>
between the yo: and the <form>. However, now there is the moral equivalent
of a <br/>.

Thanks for the tip, and I will use it to reduce the blank spaces around some
other forms. However, I still have a form that I don't want a break before.
I need to learn to insert tiny forms inline among text.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #4

P: n/a
On Sun, 07 Nov 2004 20:06:50 GMT, Phlip <ph*******@yahoo.com> wrote:
Leif K-Brooks wrote:
Phlip wrote:

> How do I avoid paragraph breaks around a <form> tag?


If you're referring to margins when you say "paragraph breaks", use
this:

form {
margin : 0;
padding : 0;
}


Okay, that leads to this:

yo:<form style="margin:0;padding:0"><input type="edit"></form>

That's giving me this:

yo:
[ ]

Without the 0 padding stuff, there would be the moral equivalent of a
<p/>
between the yo: and the <form>. However, now there is the moral
equivalent
of a <br/>.


Right. That's because form is inherently block. Try this:

yo:<form style="margin:0;padding:0;display:inline;"><input
type="edit"></form>
Jul 23 '05 #5

P: n/a
Neal wrote:
yo:<form style="margin:0;padding:0;display:inline;"><input
type="edit"></form>


yo:[ ]

Yes! Thanks.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces

Jul 23 '05 #6

P: n/a
On Sun, 07 Nov 2004 20:21:19 GMT, Phlip <ph*******@yahoo.com> wrote:
Neal wrote:
yo:<form style="margin:0;padding:0;display:inline;"><input
type="edit"></form>

Yes! Thanks.


Actually, you should be able to dump the margin:0;padding:0; now.

Jul 23 '05 #7

P: n/a
Neal <ne*****@yahoo.com> wrote:
On Sun, 07 Nov 2004 20:21:19 GMT, Phlip <ph*******@yahoo.com> wrote:
Neal wrote:
yo:<form style="margin:0;padding:0;display:inline;"><input
type="edit"></form>

Yes! Thanks.


Actually, you should be able to dump the margin:0;padding:0; now.


Also, this won't work in Strict HTML because a form can only contain
block elements. So then you'd really need something like

form * { display: inline; }

in a stylesheet.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 23 '05 #8

P: n/a
"Phlip" <ph*******@yahoo.com> wrote in
comp.infosystems.www.authoring.html:
I have a <form> tag.

It thinks I want a <p> break before and after the form. I don't. (My forms
are sneaky and inline.)
Not quite -- it thinks that <form> is a block element, like <p>
How do I avoid paragraph breaks around a <form> tag?


Style sheets are the way; you can't do it in pure HTML. It's well
worth your time to learn CSS style sheets -- see some tutorials at
http://oakroadsystems.com/tech/webau...m#TutorialsCSS -- but for
something quick and dirty change
<form
to
<form style="display:inline"

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Jul 23 '05 #9

P: n/a
Harlan Messinger wrote:
Also, this won't work in Strict HTML because a form can only contain
block elements. So then you'd really need something like

form * { display: inline; }

in a stylesheet.


In terms of being confused for a newbie born after HTML was invented...

....now would probably not be a good time to say "But Internet Explorer likes
style='display:inline', so I'l stick with that."

It's for an in-house project, guys.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #10

P: n/a

Phlip wrote (in part):
Okay, that leads to this:

yo:<form style="margin:0;padding:0"><input type="edit"></form>

That's giving me this:

yo:
[ ]


Try:

yo:<form style="margin:0;padding:0;display:inline"><input
type="edit"></form>

That should give you "yo:[ ]".

Ken

Jul 23 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.