472,099 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,099 software developers and data experts.

<form> without <p> break

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
10 8829
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
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
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
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
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
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
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
"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
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

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.

Similar topics

2 posts views Thread by Kai Grossjohann | last post: by
14 posts views Thread by Ian Rastall | last post: by
129 posts views Thread by Torbjørn Pettersen | last post: by
6 posts views Thread by snacktime | last post: by
1 post views Thread by Hai Nguyen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.