473,748 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3874
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
6193
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 type="submit"><select name="N"> <option value="1234#1234-01">foo <option value="1010#1010-02">bar <option value="1001#1001-03">baz
2
2602
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;" class="search_top">go</a> What do I put within to access the value of the input field search so I can access it's value? Thanks,
19
2899
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
1369
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' versions of IE 6.1 using XP and my Firefox 2.0 using Linux); even the <form> tags themselves vanish. Everything else produces w/o problem whatsoever. Thanx Phil
4
4829
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 form "FormDummy" onto the main form, and then the event no longer fires again when the user change the value of the drop down list. Can anybody help ? Thanks so much! The aspx code is as follows:
3
2214
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 or any wrong thing is there?
3
3514
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. However, if I do the same in IE, nothing happens. For whatever reason, IE will not take that content. Has anybody run into this, and what's a good solution? (Please, no "use FireFox!" answers - we have users that use both equally).
1
1406
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 webcontrol is a part of Default.aspx page where I have <form runat=server> tag. But this tag does not cover this webcontrol - let's say "header" webcontrol 'cos it is needed by other webcontrols. So ... telling in short I cannot have <form runat=server> in...
5
13869
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 href="mypage.php?name='.$myname.'...>Save</a>'; i want that $myname will the value of myname textbox. something like this: $myname= <the value of the textbox>
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.