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

suppressing margins on <form> and <a href> tags

P: n/a
I've searched and searched and have not found a solution to suppress
the margin on form or href tags so that there is no space before or
after the tag. The only way I have found to do this is to place the
tags one after another without any spaces between them.

For example, a space gets rendered between these two href's when
displayed in firefox or IE.

<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>
<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>

But if I place them together without any spaces or linebreak, no space
is rendered.

<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a><a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>
Adding display:inline or margin: 0 doesn't have any effect on the href.
For a <form> tag display:inline gets rid of the line break but not the
space at the end of the tag.

Any ideas on a solution?

Sep 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
snacktime a écrit :
I've searched and searched and have not found a solution to suppress
the margin on form or href tags so that there is no space before or
after the tag.
If I may say so, always start searching in FAQs:

Web Authoring FAQ
http://www.htmlhelp.com/faq/html/all.html

All My FAQs
http://allmyfaqs.com/

Alt.html FAQ
http://www.html-faq.com/

The only way I have found to do this is to place the tags one after another without any spaces between them.

For example, a space gets rendered between these two href's when
displayed in firefox or IE.

<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>
<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>

The above code is not sufficient in order to know what is going on. Are
those links in a table cell? Are those links inside a div? a positioned
layer? Is the space before/after due to normal flow? What's before and
what's after the links?

You have provided insufficient code to say.
But if I place them together without any spaces or linebreak, no space
is rendered.

<a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a><a href="#"><img border="0" height="10" src="test.gif" width="10"
/></a>
Adding display:inline or margin: 0 doesn't have any effect on the href.
For a <form> tag display:inline gets rid of the line break but not the
space at the end of the tag.

Any ideas on a solution?


Web Authoring FAQ: HTML Forms FAQ
10.4. How can I eliminate the extra space after a </form> tag?
http://www.htmlhelp.com/faq/html/for...l#form-nospace

Gérard
--
remove blah to email me
Sep 19 '05 #2

P: n/a
Actually I was incorrect about the form tag when it comes to IE, but
the margin has no effect that I can tell on an href. Also, in firefox
you still get the same effect of a space after the form because it
doesn' appear you can set the margin on other form elements such as a
submit button. So if you have a space in your code between the last
form element and the ending form tag you still get a space between two
adjacent forms even if you have the margin set to 0.

As for the context, it is enough to answer my question. If the content
was surrounded by anything else I would have said so.

Sep 19 '05 #3

P: n/a
Zif
snacktime wrote:
Actually I was incorrect about the form tag when it comes to IE, but
the margin has no effect that I can tell on an href. Also, in firefox
There is no such thing as an href element or tag, it is an attribute of
an A element.
you still get the same effect of a space after the form because it
doesn' appear you can set the margin on other form elements such as a
There is only one form element defined in the HTML specification. Other
elements nested inside a form element can be form controls (e.g. input,
text area, select).
submit button. So if you have a space in your code between the last
form element and the ending form tag you still get a space between two
adjacent forms even if you have the margin set to 0.
Whitespace is handled according to whitespace rules, which may vary from
browser to browser.

<URL: http://www.w3.org/TR/CSS21/text.html...ef-white-space >

As for the context, it is enough to answer my question. If the content
was surrounded by anything else I would have said so.


Your code appeared to be XHTML (e.g. '<img ... />'), which can be
rendered differently to HTML in some circumstances. No doctype was
hinted at, so only guesses remain.

You seem to think that there is an href element, you said you'd
attempted to modify the default style properties. You didn't say how
you attempted it, the context of your posts suggest you tried:

<style ...>
href {display: inline;}
</style>

Had that information been provided, the reason why that failed could
have been explained - but no indication was given as to how you
attempted to apply the style.
--
Zif
Sep 19 '05 #4

P: n/a

Zif wrote:
snacktime wrote:
Actually I was incorrect about the form tag when it comes to IE, but
the margin has no effect that I can tell on an href. Also, in firefox


There is no such thing as an href element or tag, it is an attribute of
an A element.


you still get the same effect of a space after the form because it
doesn' appear you can set the margin on other form elements such as a


There is only one form element defined in the HTML specification. Other
elements nested inside a form element can be form controls (e.g. input,
text area, select).
submit button. So if you have a space in your code between the last
form element and the ending form tag you still get a space between two
adjacent forms even if you have the margin set to 0.


Whitespace is handled according to whitespace rules, which may vary from
browser to browser.

<URL: http://www.w3.org/TR/CSS21/text.html...ef-white-space >

As for the context, it is enough to answer my question. If the content
was surrounded by anything else I would have said so.


Your code appeared to be XHTML (e.g. '<img ... />'), which can be
rendered differently to HTML in some circumstances. No doctype was
hinted at, so only guesses remain.

You seem to think that there is an href element, you said you'd
attempted to modify the default style properties. You didn't say how
you attempted it, the context of your posts suggest you tried:

<style ...>
href {display: inline;}
</style>

Jesus christ, is everyone on this list so anal? So I called an element
by the wrong name, anyone with half a brain would know what I meant
from the example. In any case I'm unsubscribing from this group. If
such a simple question evokes these types of responses, I'll go
elsewhere or figure it out on my own.

Chris

Sep 19 '05 #5

P: n/a
snacktime wrote:

Jesus christ, is everyone on this list so anal? So I called an element
by the wrong name, anyone with half a brain would know what I meant
from the example. In any case I'm unsubscribing from this group. If
such a simple question evokes these types of responses, I'll go
elsewhere or figure it out on my own.

You come here asking for *free* help, provide a vague problem
description, use incorrect or misleading terminology, refuse to give code
samples or an URL, ignore given advice, then bitch about the result? Piss off.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sep 19 '05 #6

P: n/a
snacktime wrote:
is everyone on this list so anal?
No, but our computers are.
anyone with half a brain would know what I meant
My browser has one processor but not even half a brain. As a general
rule, many of the problems posted round here are caused by exactly this
problem. _You_ might "know what you meant", but the browser never does
unless you tell it: in great detail and according to the proper rules.
Don't moan at me about it, we just tell them how we find them.

There's also the problem of context. Something that works fine in two
lines of example often fails on a real site because the server is
sending out headers claiming to be utf-welsh. Give us a URL, then we
get the full picture and what's really going on.

In any case I'm unsubscribing from this group.


Don't let the door hit you in the arse on the way out.

Sep 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.