474,028 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does IE add a pixel of white space around my links?

Hello,

Here I am again with another "why does IE do that" question!!

Please have a look at http://www.kidsinaction.org.uk/fd/homepage.html
and see if you can work out why IE adds a one pixel white space on the
left and right side of the links with the light-green backgrounds. It
doesn't do it on the header links, which have darker green backgrounds.

FF and Opera don't add the pixel at all, which is what I would expect as
I set left and right margins to zero for all relevant elements.

Any suggestions? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 26 '06
28 1950
VK

VK wrote:
simply open the
OP's link in IE 6, File > Save As > Web page complete. You will get the
normalized version of the page: not what is served from the server, but
what IE sees internally.


I forgot to mention that it also will reveal the sad fact that your
XHTML declaration goes by the "Unrecogniz ed DTD" rule as spelled in the
same article (which I hope you already printed out and finished fixing
on the wall near of your computer :-)
So any XHTML (even the most Strict) in IE becomes "-//W3C//DTD HTML
4.01 Transitional//EN" pollued with all kind of trash all around :-(
;-)

Apr 27 '06 #11
On 27/04/2006 11:15, VK wrote:
Johannes Koch wrote:
VK wrote:
In CSS1Compat mode there are not default measurement units, so IE
has all rights to ignore margin:0 declaration.
Why?


Because they decided so


No, they didn't.
and currently it's build into UA.
No, it's not.
<http://www.w3.org/TR/REC-CSS1#length-units>:
After a '0' number, the unit identifier is optional.


[snip]
In the particular "Stricter Style Sheet Parsing" section states:
<quote>
Values without unit type identifiers and values with white space
between the number and the unit type identifier are ignored.
Note: There is one exception to this rule. The line-height explicitly
accepts unitless numbers and treats them in a manner similar to a
percentage setting. For example, "line-height: 2" is similar to
"line-height: 200%," differing only in how the number inherits.
</quote>

As you can see, zero values are not in the list.
It doesn't need to be. A length value of zero (0) is a rather obvious
special case: a value of zero, in any unit, is still zero.
And indeed margin:0 makes IE in CSS1Compat mode upset.
Rubbish.
To check that out, simply open the OP's link in IE 6, File > Save As
Web page complete. You will get the normalized version of the page:

not what is served from the server, but what IE sees internally.
Compare the treatment for paddings and for margin:0 in the normalized
version.


You mean,

margin: 0px;

rather than:

margin: 0;

So what? They are equivalent.

If MSIE chooses to normalise zero length values to '0px', that's its
business. It does far stranger (and patently wrong) things when
'normalising' markup. One could only claim that it ignores declarations
containing unit-less zero values if those declarations were actually
removed during the normalisation process, but they aren't. Compare its
behaviour with unit-less non-zero values: these /are/ removed.

Once again, you observe simple behaviour, and somehow manage to draw the
wrong conclusions.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Apr 27 '06 #12
In article <11************ **********@u72g 2000cwu.googleg roups.com>, VK
<sc**********@y ahoo.com> writes
Must be because the link boxes are having "pack width" as opposed to
"max width". By setting width:100% for LI elements eliminates the gaps.


Thanks, that was the simplest solution.

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 27 '06 #13
In article <11************ **********@u72g 2000cwu.googleg roups.com>, VK
<sc**********@y ahoo.com> writes
btw if you decided to force W3C on IE, then play by the rules ;-) In
CSS1Compat mode there are not default measurement units, so IE has all
rights to ignore margin:0 declaration. It doesn't do it of a good of
its heart :-) but margin: 0px 0px would be more appropriate.


Funny, I used to use units for zero measurements, but having seen people
here say many times that you don't need them, I thought I'd be al grown
up and leave them off. Looks like I should have stuck with my old
habits!!

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 27 '06 #14
In article <11************ *********@g10g2 000cwb.googlegr oups.com>, VK
<sc**********@y ahoo.com> writes

VK wrote:
simply open the
OP's link in IE 6, File > Save As > Web page complete. You will get the
normalized version of the page: not what is served from the server, but
what IE sees internally.
I forgot to mention that it also will reveal the sad fact that your
XHTML declaration goes by the "Unrecogniz ed DTD" rule as spelled in the
same article (which I hope you already printed out and finished fixing
on the wall near of your computer :-)


Printing out even as we speak. Will probably be stuck on the toilet
wall, partly as it is more likely to be read there, and partly because
it seems like an appropriate place to put an article about IE's
"advanced" handling on CSS!!
So any XHTML (even the most Strict) in IE becomes "-//W3C//DTD HTML
4.01 Transitional//EN" pollued with all kind of trash all around :-(
;-)


Harumph. Dontcha just *lurve* IE?

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 27 '06 #15
On 27/04/2006 16:03, Alan Silver wrote:

[snip]
Funny, I used to use units for zero measurements, but having seen people
here say many times that you don't need them, I thought I'd be al grown
up and leave them off. Looks like I should have stuck with my old habits!!


When the majority say something - in this case, that units are optional
for zero length values - and VK says something else, ignore the latter.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Apr 27 '06 #16
On Thu, 27 Apr 2006 16:02:40 +0100, Alan Silver
<al*********@no spam.thanx.inva lid> wrote:
In article <11************ **********@u72g 2000cwu.googleg roups.com>, VK
<sc**********@ yahoo.com> writes
Must be because the link boxes are having "pack width" as opposed to
"max width". By setting width:100% for LI elements eliminates the gaps.


Thanks, that was the simplest solution.


It doesn't work for me. The li width has to be 99% and the visited,
etc. width has to be 100%. And I haven't tested on different
resolutions.

Ken

Apr 27 '06 #17
On Thu, 27 Apr 2006, Michael Winter wrote:
On 27/04/2006 16:03, Alan Silver wrote:
Funny, I used to use units for zero measurements, but having seen
people here say many times that you don't need them, I thought I'd
be al grown up and leave them off. Looks like I should have stuck
with my old habits!!


When the majority say something - in this case, that units are
optional for zero length values - and VK says something else, ignore
the latter.


As always with usenet, it's best to use the answers as clues, and go
read the specification to see what it really says. Even those of us
who care about giving accurate answers are going to make mistakes from
time to time.
Apr 27 '06 #18
VK

Michael Winter wrote:
On 27/04/2006 16:03, Alan Silver wrote:

[snip]
Funny, I used to use units for zero measurements, but having seen people
here say many times that you don't need them, I thought I'd be al grown
up and leave them off. Looks like I should have stuck with my old habits!!


When the majority say something - in this case, that units are optional
for zero length values - and VK says something else, ignore the latter.


OK, OK! In the very first post here I said <q>IE has all rights to
ignore margin:0 declaration. It doesn't do it of a good of its heart
:-)</q>
(where once again "rights" are based on Microsoft own specs, not W3C
ones).

So later assumption (that it makes it upset) was wrong. I just did not
read right the "normalized " source code. It appears that while IE rolls
up PADDING shortcut so it becomes PADDING-LEFT, PADDING-TOP etc., the
MARGIN shortcut is not rolled up. I originally thought that if was
caused by margin:0; declaration, but it stays the same for any
declaration.

So yes, everyone is entitled for his holly right to use margin:0
shortcut :-)

About the statement the "0 is always 0 in any mesures" it is correct
for a simple case like margin:0;
It is getting more puzzling in a case like margin: 0 .5em (space after
0). Should UA interpret it as margin:0.5em or as margin: 0px 0.5em or
as an incorrect declaration? But of course W3C thought all detail to
the end I'm sure.

Apr 27 '06 #19
In article <r4************ *************** *****@4ax.com>, Ken Loomis
<no************ **@address.com> writes
Must be because the link boxes are having "pack width" as opposed to
"max width". By setting width:100% for LI elements eliminates the gaps.


Thanks, that was the simplest solution.


It doesn't work for me. The li width has to be 99% and the visited,
etc. width has to be 100%. And I haven't tested on different
resolutions.


Hmm, I just tried it on IE6, FF and Opera and they all worked fine. IE5
showed some extraneous spaces below the links, but the widths were fine.

What browser, font size, etc were you using when it didn't work?

I've updated the sample page to show my latest incarnation. Please try
this one and see if it works for you. I'm puzzled as to how it works for
me and not you.

http://www.kidsinaction.org.uk/fd/homepage.html

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Apr 27 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2239
by: StopBsod | last post by:
Hello group, I use XSLT to output a unix shell script based on the content of an XML file : The XSLT : <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template name="haut" match="/rhythmdb">
20
1001
by: Stephen Poley | last post by:
People in these groups, and on web-pages, not infrequently suggest that it is worthwhile cutting down on white-space and comments in HTML and CSS in order to reduce loading times. I and others have more than once doubted this, given the data-compression in the HTTP protocol. Having seen it suggested again a couple of times in the last few days, I decided it was time for a test on the effect of white-space. I took one of my pages:...
6
1575
by: Kor | last post by:
Hi, Does anybody understand why the technique described in http://www.macromedia.com/devnet/server_archive/articles/css_positioning_dynamic_repositioning.html doesnt work in Netscape 6/7 and Mozilla? I tried it out but to no avail. I am certainly not a (javascript) programmer / DOM expert but it seems to me it should work (see for example http://www.quirksmode.org/dom/w3c_html.html )
3
3381
by: Prince | last post by:
I have some <RequiredFieldValidator> on my page and everything works fine except that there are lots of white spaces between the web server controls that are being validated. I've set the Display properties for all the controls to "Dynamic" and still I can't get rid of the white spaces between controls. It's as if there are bunch of <br> tags separating the controls. For example,the "HTML" look similar to this.
13
2728
by: Harlan Messinger | last post by:
What rules deal with attribute values with trailing spaces, or tags or attribute values with embedded newlines? Examples below: the HREF with embedded newline, the SRC with trailing spaces, and IMG tag spread over multiple lines. <a href="myself.html "> <img src="/images/picture.gif " width="80" height="65" alt="What, me worry?"></a>
4
3739
by: Johny | last post by:
I use PIL to write some text to a picture.The text must be seen wery clearly. I write the text to different pictures but to the same position. As pictures maybe different, colour, in the position where I write the text, is also different. Is there a way how to set the font colour so that it will be seen very clearly in the picture? For example, if the picture is bright ( for example yellow), the font colour should be dark( e.g. black)...
5
13655
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as semantically meaningless containers for bunch's of other elements - like everyone keeps telling me to make my code standards compliant. This request is not because I want a fix, but because I want to
5
13989
tharden3
by: tharden3 | last post by:
How do I remove white space around an icon? I have been using some helpful icon pics from google images to spice up a website that I'm making. In many instances though, the icon is not square, but irregularly shaped, leaving white space to make a square around the icon. In one case, I was using a 16 x 16 gif image of a movie reel (a round object) but I could not get rid of the white space around the object. How can I do this?
1
3255
by: ofiras | last post by:
In bitmap, how can I find the nearest pixel (pixel 1) to a specific pixel (pixel 2) that has different color from pixel 2? Or how can I find a pixel in a specific distance from pixel 2 (like a circle that pixel 2 is his center, and I'm looking for a pixel that has different color that pixel 2)? (I'm trying to do a voronoi diagram maker, so I need to search for the nearest colored pixel in my bitmap for every pixel that is not colored...
0
10507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
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,...
1
11932
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11101
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...
0
10270
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8659
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
7821
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();...
0
6614
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.