CSS a:hover background-color display:block<p align=left><font face=Arial size=2>It seems like a:hover {background-color:value;} does not work as expected in IE8 beta2 if the element has display:block or inline-block. The hover style will get applied if there is a background-color value defined for the default state only.  </font></p> <p> </p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p align=left>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML Strict//EN&quot;&gt;&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;&lt;title&gt;&lt;/title&gt;</p> <p align=left>&lt;STYLE&gt;<br>HTML BODY {<br> background-color : #e7e7e7;<br>}<br>A {<br>  display : block; <br>}<br>span.withbg A {<br>  background-color:white;<br>}<br>A:hover,<br>span.withbg A:hover {<br>  color:blue;<br>  background-color:black;<br>}<br>&lt;/STYLE&gt;&lt;/HEAD&gt;<br>&lt;BODY&gt;</p> <blockquote dir=ltr style="margin-right:0px"> <p align=left>&lt;p&gt;<br>   &lt;span&gt;&lt;A href=&quot;#&quot;&gt;A link WITHOUT background color&lt;/A&gt;&lt;/span&gt;<br>   &lt;span class=&quot;withbg&quot;&gt;&lt;A href=&quot;#&quot;&gt;A link WITH background color&lt;/A&gt;&lt;/span&gt;<br>&lt;/p&gt;</p></blockquote> <p align=left>&lt;/BODY&gt;</p> <p align=left>&lt;/HTML&gt;</p> <p align=left> </p></div></div> <p align=left> </p> <p></p> <p align=left> </p>© 2009 Microsoft Corporation. All rights reserved.Wed, 10 Dec 2008 23:17:14 Z0d5c19ff-49c8-49e7-92a8-37d9df4f14dahttp://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#0d5c19ff-49c8-49e7-92a8-37d9df4f14dahttp://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#0d5c19ff-49c8-49e7-92a8-37d9df4f14daclanceyphttp://social.msdn.microsoft.com/Profile/en-US/?user=clanceypCSS a:hover background-color display:block<p align=left><font face=Arial size=2>It seems like a:hover {background-color:value;} does not work as expected in IE8 beta2 if the element has display:block or inline-block. The hover style will get applied if there is a background-color value defined for the default state only.  </font></p> <p> </p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p align=left>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML Strict//EN&quot;&gt;&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;&lt;title&gt;&lt;/title&gt;</p> <p align=left>&lt;STYLE&gt;<br>HTML BODY {<br> background-color : #e7e7e7;<br>}<br>A {<br>  display : block; <br>}<br>span.withbg A {<br>  background-color:white;<br>}<br>A:hover,<br>span.withbg A:hover {<br>  color:blue;<br>  background-color:black;<br>}<br>&lt;/STYLE&gt;&lt;/HEAD&gt;<br>&lt;BODY&gt;</p> <blockquote dir=ltr style="margin-right:0px"> <p align=left>&lt;p&gt;<br>   &lt;span&gt;&lt;A href=&quot;#&quot;&gt;A link WITHOUT background color&lt;/A&gt;&lt;/span&gt;<br>   &lt;span class=&quot;withbg&quot;&gt;&lt;A href=&quot;#&quot;&gt;A link WITH background color&lt;/A&gt;&lt;/span&gt;<br>&lt;/p&gt;</p></blockquote> <p align=left>&lt;/BODY&gt;</p> <p align=left>&lt;/HTML&gt;</p> <p align=left> </p></div></div> <p align=left> </p> <p></p> <p align=left> </p>Fri, 19 Sep 2008 11:32:20 Z2008-09-19T11:32:20Zhttp://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#348e1b2d-46eb-4157-ba6e-12352e74f6d6http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#348e1b2d-46eb-4157-ba6e-12352e74f6d6Lance Leonard - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Lance%20Leonard%20-%20MSFTCSS a:hover background-color display:block<p>Hi Clancey,</p> <p align=left> </p> <p align=left>Can you describe the desired effect in more detail?  I've run your sample in both Firefox and IE 8 Beta 2 and it looks like the background color is applied to both links when you point to them with the mouse.  </p> <p align=left> </p> <p align=left>I did notice a difference when viewing the page in IE8 Mode, but given the Firefox behavior, I'm not sure I really understood what you're trying to achieve and what's happening instead.  Would you mind clarifying?</p> <p align=left> </p> <p align=left>Thanks in advance...</p> <p align=left> </p> <p align=left>-- Lance</p> <p align=left> </p> <p align=left> </p> <p align=left><font face=Arial size=2></font> </p>Sat, 20 Sep 2008 18:53:08 Z2008-09-20T18:53:08Zhttp://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#c8fc08b0-0156-4daa-8285-3b9a845ef5b6http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0d5c19ff-49c8-49e7-92a8-37d9df4f14da#c8fc08b0-0156-4daa-8285-3b9a845ef5b6unique_usernamehttp://social.msdn.microsoft.com/Profile/en-US/?user=unique_usernameCSS a:hover background-color display:block<font size=2><span style="font-family:Arial">@clanceyp<br><br>Yes, there is a bug here, but there's a few catches.<br><br>1.) It works 100% fine, if (AND ONLY IF) you are in 100% IE8 Standards mode, which means you must have a valid DOCTYPE, ***AND*** you MUST be viewing the page on an INTERNET (not INTRANET) site.  For reasons that no good explanation was ever given, IE8 defaults to standards mode on the INTERNET, but defaults to Standards-Dont-Matter mode if you are viewing a site on the INTRANET.<br><br>The bug you are noting, affects previous versions of IE is tracked here if you are intested:<br><a title="http://webbugtrack.blogspot.com/2008/02/bug-229-not-everything-is-absolute-in.html" href="http://webbugtrack.blogspot.com/2008/02/bug-229-not-everything-is-absolute-in.html">http://webbugtrack.blogspot.com/2008/02/bug-229-not-everything-is-absolute-in.html</a><br><br>Best of luck<br></span></font>Mon, 22 Sep 2008 14:25:13 Z2008-09-22T14:25:13Z