Sharon's Blog

random thoughts from a morphing chameleon  

Home » August 2009 » IE8, CSS and Visual Studio
IE8, CSS and Visual Studio

Took the plunge and upgraded my dev machine to IE8 last week. Got a bit frustrated with developing a site, styling CSS so that all looked great in IE6/7, Firefox, Chrome and Safari, uploading to stage, then viewing in IE8 and discovering little quirks that have to be fixed.

So, then with IE8 on the machine I use the most, discover how many times I've got to set a site (not ones I've done) to view in compatibility mode. All well and good, and it's easy enough with the click of a button.

Then today, frustration plus! Working on a project and want to run from VS in debug. Set a stop, run, project builds, site opens, no debug! Hmmm, check my code again. No debug! What? So I open something I was working on about 2 weeks ago, set a stop, run, project builds, site opens, no debug! Now, I KNOW it was debugging last time I worked on this one!

A big of googling, and ... whallah ... http://dpotter.net/Technical/2009/05/upgrading-to-ie8-breaks-debugging-with-visual-studio-2005/

So that solves that little problem.

But then I discover CSS in compatibility mode doesn't seems to be "true" IE7. I was trying to style the main menu here to have the solid green background for selected item, joined to the green stripe across the top. In compatibility mode, there was a 1px gap between the stripe and the menu item. Eventually resolved it with a css hack:

     top: 0px;
     !top: -1px;
     _top:
-1px;

I'm certainly not a CSS export, but from what I found googling, the ! and _ prefixes are applied only by IE and are ignored by other browsers. Problem is, css no longer authenticates! So, I added an IE7-specific stylesheet, as per http://css-tricks.com/how-to-create-an-ie-only-stylesheet/. Beautiful, css authenticates again. Switch IE8 to run in compatibility mode, but the IE7-specific stylesheet is ignored - probably because we're not actually running IE7!

Oh well, just have to put up with the dodgy css authentication!

Comments
Blog post currently doesn't have any comments.