Problem with dotted css borders on IE
adrien
Status: Curious
Joined: 12 Jul 2006
Posts: 8
Reply Quote
Hi,

I've made a menu with "dashed" borders. It works well on Firefox and Opera but there's a bug on IE. When I scroll down the page, the "dashed" borders become "solid" borders.

My project isn't online but here's an example:
www.csszengarden.com/?cssfile=028/028.css

Thanks.
Adrien
Back to top
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 594
Reply Quote
Yes, you've correctly diagnosed the problem, there is in fact a bug, well, there are a plethora of bugs re CSS and HTML in MSIE.

That's one of them. So what do you do?

You can't fix MSIE, but you can give MSIE slightly different border definitions, re the MSIE conditionals:

:: Code ::
<!--[if lte IE 6]>
<style type="text/css" media="all">.borderitem {border-style:solid;}</style>
<![endif]-->

Make sure to make it lte IE 6 because IE 7 will probably not have these issues.

Place this block inside of the <head> tags of your page.

You can also try a different border style, say dotted instead of dashed, but I think that bug exists for both.

I don't like CSS zengardens as a source for realworld css solutions, it's good to get ideas, but they tend to show stuff that only works on real browsers like opera, firefox, or safari.
Back to top
adrien
Status: Curious
Joined: 12 Jul 2006
Posts: 8
Reply Quote
Thank you very much jeffd. It's perfect.

By the way, I had never seen such a thing as <!--[if lte IE 6]>

Is that HTML? I thought you had to use JavaScript to do that sort of thing.
Back to top
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 594
Reply Quote
That's a proprietary MS only thing, only MSIE >= 5 can read that.

All other browsers simply see it as a comment.

Since it's a comment to other browsers and spiders, it validates fine.

It was actually nice of MS to implement that, it was almost openly admitting that their browsers sucked and would need msie only fixes for css and things like that.

You can put anything in that block by the way, not just css fixes. Make sure, of course, to put the css fixes after the main css libraries are loaded.

Read more about them on msdn.microsoft.com.

By the way, it's FAR BETTER to use these than some type of browser detection, these will work on all MSIE based browsers, like crazy browser, no matter how it identifies itself. That's because it's the rendering engine itself that parses and processes this command.
Back to top
adrien
Status: Curious
Joined: 12 Jul 2006
Posts: 8
Reply Quote
ok. Thanks.
Back to top
vkaryl
Status: Contributor
Joined: 31 Oct 2004
Posts: 273
Location: back of beyond - s. UT, closer to Vegas than SLC
Reply Quote
One caveat: my daughter discovered that there are some hinks in IE7 (oh THERE'S a surprise!), and in order to cover the situation, you actually need to use (depending on what bugs you're going to be addressing!)

:: Code ::

<!--[if IE]>
<style type="text/css" media="all">.borderitem {border-style:solid;}</style>
<![endif]-->


because otherwise IE7 can be borked almost moreso than IE6 ever was. I didn't actually get the specifics (it was a flying phone convo - her in another country, me on my way out the door), but I'll check intot it further eventually.
Back to top
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 594
Reply Quote
See, there I go again, trying to be optimistic. Why I even hope that MS will finally take its browser seriously is beyond me, you'd think that 5 years of being ignored would have shown me, but I guess I'm just dense that way.

On the bright side, Firefox has gained a few percentage points in marketshare. That's an older article, a new one just came out last month, more percentage point increases globally, also a review of that new study here.

And remember, extensions are like heroin, you start out thinking, oh, I'll just try one or two, then you're hooked, you need your firefox fix, windows, mac, linux, doesn't matter, I just... need... my... extensions... please, adblock, tabbrowser plus... they have so many to chose from, guaranteed to catch anyone who looks for them. Did I mention sort bookmarks? Trivial to massive, doesn't matter, you're hooked no matter what.
Back to top
vkaryl
Status: Contributor
Joined: 31 Oct 2004
Posts: 273
Location: back of beyond - s. UT, closer to Vegas than SLC
Reply Quote
Need a 10-step program, do we? *laughing* But yes, I as well am an extension junkie....
Back to top
Display posts from previous:   

All times are GMT - 8 Hours