Nov 7, 2009
Pages: 1, 2

Ie Whitespace Bug - Oh, no... I can't defeat it!

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Ie Whitespace Bug - Oh, no... I can't defeat it!

szupie
Anyone know of the IE whitespace bug that occurs when you apply display: block; to an <a> element inside a <ul> element? I'm trying to create a side navigation menu that involves links inside lists, and I can't fix the bug... I have searched for many solutions, but none have worked for me. Anyone know why the workarounds work sometimes but not at other times?

Comment/Reply (w/o sign-up)

vizskywalker
szupie, can you be more specific about what the whitespace error is?

~Viz

Comment/Reply (w/o sign-up)

szupie
When you want to turn a link into a button, you can use css to make it display: block, which makes an anchor clickable anywhere in the box around it. But when the anchor is inside an unordered list like this:
CODE
<ul><li>
 <a href="hello.htm">sdsdf</a>
</li></ul>

Internet Explorer would parse the carriage return after the <li> as a whitespace, and would add an extra gap around the <a>. The only certain way I know of is to remove every return in the code, like this:
CODE
<ul><li><a href="hello.htm">sdsdf</a></li></ul>

But that would make the code too hard to read. That's why I'm looking for an alternate solution that would work at least most of the time.

Comment/Reply (w/o sign-up)

vizskywalker
I'll look into it for you, but for now try using the <whitespace> tag with I forget which option to prevent the reading of whitespace.

~Viz

Comment/Reply (w/o sign-up)

szupie
Hmm, I've never heard of a whitespace tag, nor can I find it on Google. Are you sure that exists in HTML/XHTML?

BTW, I'm trying to follow web standards in my site, so I don't want to use solutions that are non-standard. However, if you think the solution is the best one, I may try to work it into my site.

Comment/Reply (w/o sign-up)

saint-michael
did you look at these websites

http://www.positioniseverything.net/explor...loatIndent.html
http://www.csscreator.com/index.php?topic=9016

this should help you with what your looking for.

Comment/Reply (w/o sign-up)

vizskywalker
There is no whitespace tag sorry, I was thinkingg there was because there are a couple tags I lump into the whitespace category. The tag I was thinking of is the <pre> tag which is in the XHTML standard, but it needs the closing </pre> tag after the text.

~Viz

Comment/Reply (w/o sign-up)

clagnol
I've never encountered the particular bug you reference, but I've often exerienced IE whitespace bugs. Have you tried redefining the UL class to specify how much whitespace should exist around it? Have you considered using a server-side language, such as PHP to detect the visitor's browser and serve an IE or other version of the page accordingly? Just some thoughts.

Comment/Reply (w/o sign-up)

szupie
saint-michael: Thank you, but I don't think the first link is what I was looking for. It was about IE's margin problems, while what I'm experiencing is a problem in IE's rendering of spaces. I have read the second link before, but the given solutions didn't work for me.

vizskywalker: Hmm, the pre tag gave me a whole blank row after each list item, even in Firefox.

clagnol: Again, it's a problem in IE's rendering of whitespaces, so changing the margin or padding (I assume that's what you're talking about) wouldn't help. I don't like browser detection, since it can be buggy sometimes. Opera identifies itself as IE, even though it may not have the same bugs as IE.

Comment/Reply (w/o sign-up)

mastercomputers
Hey szupie,

This bug exists in Firefox under some different elements too, which I filed a bug report for it about a month ago as well as a solution. I know under W3C whitespacing is suppose to be excluded unless you specified the style white-space: pre; and that whitespaces be converted to spacing that HTML understands.

For readability I use to do the same as you would do, but now I write some elements inline just so I do not have that problem. It's not a major loss to readibility though, it's still quite clean.

I don't know if IE7 has made any improvements on this (but they are far behind, web technology wise), but Firefox are fixing the elements I pointed out which will be definitely in an upcoming release.

If I was you, I would just go with losing that minor readibility for consistency sake, as if most browsers are falling under this then it's best to have it working on the majority of them, than trying to get all these browsers fixing those problems.

Cheers,


MC

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : Whitespace Bug Can39t Defeat It33


    Looking for whitespace, bug, defeat

See Also,

*SIMILAR VIDEOS*
Searching Video's for whitespace, bug, defeat
advertisement



Ie Whitespace Bug - Oh, no... I can't defeat it!

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com