Jump to content


CSS SOS (ie6 versus the world)


7 replies to this topic

#1 The Wicked Flea

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 10 August 2006 - 12:39 PM

Firstoff this problem is really screwy, since in FF1.5 and IE7 the buttons look just fine, but in IE 6 they have no top border.

The HTML is a generic UL within a named DIV, and within the list items there are links. The links themselves are styled as the buttons. So a quick and dirty example is:

<div id='mainMenu'>
  <ul>
	<li><a href=#>This is link 1</a></li>
	<li><a href=#>This is link 2</a></li>
	<li><a href=#>This is link 3</a></li>
  </ul>
</div>

My CSS in general terms looks like this for the button styles:
#mainMenu ul {
  padding: 0px;
  margin: 0px;
}

#mainMenu li {
  display: inline;
}

#mainMenu li a {
  font-family: Verdana, Arial, Sans-Serif;
  font-size: 12pt;
  background-color: #AAA;
  border: 2px solid #999;
  border-color: #BBB #999 #999 #BBB;
  color: black;
  padding: 1px 3px;
  bottom: -2px; /* reccommended because of a XHTML 1.0 Transitional Doctype */
}

#mainMenu li a:hover {
  border-color: #999 #BBB #BBB #999;
}

As you can see it makes a simple buttonized appearance and on hovering inverts the bevel to make it look inset. I haven't tested these colors so no promises that they look good, but they get the idea across. However in IE6 no top border appears, regardless of the "bottom: -2px;" fix reccommended by a JS/CSS site I frequent (I won't point fingers). I have attached the demonstration code, and I wonder about a fix for this.

What am I doing wrong with my CSS/HTML and/or how do I work around IE6? Since most my clients will be using IE6 I have no choice but to support it, but I'm at a loss for how.

Thank you for any help! :P

Attached Files



#2 _*Zenom_*

  • Guests

Posted 10 August 2006 - 02:39 PM

Thats because IE6 wont recognize ":hover" except on "a" tags. It is best if you use 2 background images that will imitate the effect you are looking for now.

example:
http://www.pmob.co.u...srollover11.htm

Edited by Zenom, 10 August 2006 - 02:43 PM.


#3 The Wicked Flea

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 10 August 2006 - 03:12 PM

View PostZenom, on Aug 10 2006, 12:39 PM, said:

Thats because IE6 wont recognize ":hover" except on "a" tags. It is best if you use 2 background images that will imitate the effect you are looking for now.
IE6 actually supports the specific rollovers I am using currently, because it is only the A element which has the :hover attribute. My problem is that in IE6, my interface with almost exactly the same buttons has a missing top border to it. Nothing seems to bring this border back either.

The example HTML file I attached in IE 6 only has left and right borders, yet a working rollover. I'm not understanding what I've done wrong, but IE can go hang itself...

Edited by The Wicked Flea, 10 August 2006 - 03:14 PM.


#4 The Wicked Flea

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 10 August 2006 - 04:03 PM

From my experimentation I believe that this is a semi-unfixable quirk within IE. If anyone knows a workaround, please let me know, otherwise hope that IE7 fixes it.

#5 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 10 August 2006 - 04:20 PM

It doesnt lol. I tried a few things myself (in ie7) but i couldnt get it to work. I shall have another less half arsed attempted if no one else can do it, but im a bit in the middle of things atm :glare:

Edited by .Matt, 10 August 2006 - 04:20 PM.


#6 The Wicked Flea

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 10 August 2006 - 04:29 PM

Can't say I'm surprised, but I was hoping IE7 would fix that.

Thanks for your help so far, guys, this has bothered me for a day now. Let me know of any workarounds or hopefully a fix, if there is one. I don't want to use an image, since there's no guarantee about the length of a given button.

#7 seraph!m

    Pixels 4 Life!

  • Members
  • Pip
  • 172 posts
  • Location:&quot;In heavenly places...&quot;

Posted 11 August 2006 - 08:19 PM

Sounds to me like IE6 might not like that -2px on the bottom.

:blink:

#8 The Wicked Flea

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 11 August 2006 - 08:32 PM

Sadly the border problem remains on the top regardless. The bottom problem might disappear, but the top doesn't. :blink:

Try hitting the front page to my site in IE6 for another example. And it's perfectly valid CSS too, I don't mind if you take a look at it either. Just note that it's a temporary theme on the front page, mk2 isn't prepared yet.

Thanks for trying at least. ;)

Edited by The Wicked Flea, 11 August 2006 - 08:33 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users