Click here to get back home

suppressing margins on
and tags

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
suppressing margins on
and tags
snacktime 09-18-2005
Posted by snacktime on September 18, 2005, 5:08 pm
Please log in for more thread options


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?


Posted by Gérard Talbot on September 18, 2005, 8:25 pm
Please log in for more thread options


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/forms.html#form-nospace

Gérard
--
remove blah to email me

Posted by snacktime on September 18, 2005, 6:31 pm
Please log in for more thread options


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.


Posted by Zif on September 19, 2005, 3:13 am
Please log in for more thread options


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#propdef-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

Posted by snacktime on September 18, 2005, 10:22 pm
Please log in for more thread options



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#propdef-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


Similar ThreadsPosted
Style tags -- Eeek how obese these tags make HTML! November 8, 2006, 3:33 am
Print versions of HTML cut off at margins September 14, 2004, 9:01 am
margins on cleared floats in Opera November 5, 2006, 11:34 am
Meta Tags, Link Tags, other September 27, 2005, 3:29 pm
COL tags July 14, 2005, 11:30 am
overlapping tags October 26, 2004, 6:37 am
Empty Alt Tags April 1, 2005, 3:16 pm
tags April 10, 2006, 6:56 pm
New requirement for img tags? ( like ) June 11, 2006, 7:43 pm
alt vs title for img tags August 18, 2006, 2:46 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap