473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

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
6 3854
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
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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael Hamm | last post by:
Hi, I'm trying to write a <form> whihc will retrieve a Web page on another server. I have (essentially) this: <form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi"> <input...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
19
by: Wouter | last post by:
Hi, I try to make when i send a <form> that he dont open a new window. Is there someone who know how i can make this whit javascript ? Greets Wouter
6
by: phillip.s.powell | last post by:
Has anyone ever seen anything like this before? One of my co-workers' laptops fails to produce any HTML content found between well-formed <form> tags (however, the pages produce fine in others'...
4
by: George | last post by:
I'm using .NET framework 1.1 and VS.NET 2003 for a aspx web form. There is a DropDwonList on the page and its SelectedIndexChanged event is fired to the server normally, until when I add another...
3
by: Lakshmi Narayanan.R | last post by:
Hi Experts MasterPage.master In this master page, no <form> tag is used. Register.aspx Here also no <form> tag. But the form elements are working fine inside the <asp:content> tag Is it Ok...
3
by: Nebulus | last post by:
I'm having a really hard time with IE's innerHTML property and <form> tags. If I use this code: myDiv.innerHTML = "<form>This is a test</form>" in fireFox, the div tag shows the content....
1
by: Dariusz Tomon | last post by:
Hi In my project I have got several webcontrol (ascx). How can I handle with the problem: I would like to have some ASPNET object (DropDownList, InputBox etc.) in one webcontrol (this...
5
by: shotokan99 | last post by:
for instance i do have this element but i dont have a <form>: <input type="Text" name="myname" id="myname" size="30"...> then i have this link: echo'<a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.