Best approach for fixing CSS issues to work with IE 7 - css

Recently, I started maintaining a web application which unfortunately works only with IE 6. Most of the issues are related to CSS.
Is there any tool which can help me standardize the CSS classes to work with both IE 6 and IE 7? I understand I have to go through standards but I need something to start with quickly.
Firebug can help me to some extend in identifying the CSS classes related to the UI elements (if the page renders on firefox). But, I was looking for something more like an advisor tool. If you have some experience to share, please feel free.

Try out SuperPreview or the whole package (Expression Web announced at Mix)..
SuperPreview is a new free standalone application from Microsoft (still in beta) which enables you to see how your websites will look across different versions of Internet Explorer making migration from IE6 to 7 and 8 much easier than before, without have to start up a Virtual Machine to run IE6, or have a separate computer dedicated to running IE6.

Check out Dean Edwards' IE7

Tredosoft's Multiple IEs is a good compare/contrast. You go ahead and upgrade to IE7, then install this (selecting just the IE6 option, unless you need all of 5.5/5.0/4.0/etc.), and you can see the pages simultaneously in both browsers. This will help you figure out what has to be conditionalized/hacked.
Also, the IE Developer Toolbar, although not as good as Firebug et. al., will at least let you see in IE what the browser thinks is happening with your styling.

Sometimes you need to introduce a little hack for IE6 and IE7 like removing double margin and I use the following pure CSS code
css-selector { code for all browsers }
*html css-selector {code for IE6 browser }
*+html css-selector {code for IE7 browser }
it is not a tool that you expecting, but may be it would helpfull

Related

"fix internet explorer" stylesheet

I have a website that I've developed and tested using Firefox 9 exclusively. I'm pretty happy with the layout/styles when viewed in this version of Firefox. I'm now facing the unenviable task of making it display equally well (or as close as possible) in IE7+ (I'm not supporting IE6). Naturally, I'd also like it to display well in Chrome & Safari, but I think they implement the standards reasonably well, so I'm not so worried about them.
I'm using JQuery for JavaScript, which hopefully means I don't have too many differences in JavaScript behaviour, so my chief concern is the CSS. I imagine many others have been down this path, so I'm hoping there's a stylesheet available which when (conditionally) included will fix most common CSS problems seen when viewing a website in IE that has only been tested with Firefox. Does such a thing exist?
A catch-all miracle.css file which cures all IE-related ills? If only! The solution will probably boil down to a selection of some or all of the following:
Normalize (http://necolas.github.com/normalize.css/)
Brings most browser default settings to a more consistent baseline (think of this as an alternative to the popular Eric Meyer reset.css)
Modernizr (http://www.modernizr.com)
Seeing as you're already using javascript, including modernizr will give you additional methods of detecting browser capabilities. Also auto-injects .ie7 / .ie8 etc classes into your markup where necessary, allowing you to target IE in your styling, e.g.
.standard { ... }
.ie7 .standard, .ie8 .standard { ... }
CSS3PIE (http://www.css3pie.com/)
Progressive Internet Explorer - allows for styling which typically fails on IE (e.g. linear gradients, radiused corners, etc.)
IE7.JS (http://code.google.com/p/ie7-js/)
Probably the closest to what you were after, as an alternative to CSS fixes (which no doubt will still be necessary). Should help get you closer to the desired end result though.
I don't think there is any sort of stylesheet that does this for you.
You may look into a js script that look at solving IE issues. Or You can always do it the old fashion way using IETab and targeting the areas where you know there is going to be issues.
Most of them are described here: http://net.tutsplus.com/tutorials/html-css-techniques/9-most-common-ie-bugs-and-how-to-fix-them/.
Hope it helps :)

Internet Explorer 6 CSS loading issues

I saw some of the sections related to IE issues in our stackoverflow website but still my question awaits.
In my local server I am running an application which is loading JS and CSS files perfectly and working fine in IE7+ and Firefox. The problem is with IE6.
If running in IE6, able to load small amount of data but not if large data.
Able to find that the complete problem causes with CSS but don't know where I am going wrong in CSS.
I tested my application with w3c validator, it shows some minor errors which can be ignored and everything looks good.
Even using IE Fixes CSS.
Could any one please provide me some ideas, like is there any css debug for IE6.
Thanks in advance...
The Internet explorer developer toolbar may go somewhere to help you. It's extremely useful, although not as good as other browser alternatives. It can be installed on IE6. To access it once installed it's in the "convenient" place of view-->toolbars
Are you are generating a <style> element for every data row? This is common (although I don't like it) when you don't have access to the <head> element or cannot concatenate rules into a single <style> element.
If so, do you have more than 31 <style> elements? IE has a limit on the number of stylesheets, so you might be seeing that problem.
There are a lot of blog posts (and SO question) on this. Here are some of the better ones I could find:
Does IE 8 have a limit on number of stylesheets per page?, Stylesheets Not Loading? 31 Reasons to Hate Internet Explorer and Internet Explorer CSS limits.
I suggest FirebugLite (for IE6), and installing Fiddler.

Which browser we should use to see HTML CSS rendering while making a site and why?

Firefox's Latest version
IE7
IE6
IE 8
Which browser we should use to see HTML css rendering for always and why?
Edit:
My question is not on which browsers should i test site before go live. i will try to test on all possible.
My question is which browser should i choose during layout development process and why?
because while development it's not possible to see every step in all browser it will waste time. after making a layout we can test in all but during development one browser would be better.
Uhh... every one of them?
I personally develop with Firefox 3.6 for convenience and the availability of Firebug, header sniffers and other tools. I try to test in all the browsers you mention before anything goes out for anybody to see (a client for example). But I don't think there is a real "best" choice here because in the end, you will need to test for every browser you need to support anyway.
Use the most up-to-date css compliant browser with a good debugging tool e.g. Firefox 3.6 and the Firebug plug-in.
Then check in the other browsers you want to support for your users and backwards correct any errors.
Do not attempt to make the site look EXACTLY the same in all browsers, you will be wasting your time.
As long as the effect is similar in older/other browsers (for example you could use border-radius for Firefox/WebKit browsers and this will degrade nicely for browsers that don't support border-radius) and the site is usable and fulfills it's purpose, then your ok
DONT WASTE TONS OF TIME ON IE6. Use a conditional commented stylesheet and just get it usable...
In the head of the document
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="IE6.css"/>
<![endif]-->
It all depends on your target user group.
If you're working for customer that uses IE6, you will have to test for it. Sad, I know.
If you're designing a site for general public, then test for current versions of major browsers. Firefox, IE, Opera, Safari and Chrome(?).
Also: develop according to standards then fix whatever does not work in one browser or another. Not that you develop for IE, then trying to fix everything that suddenly falls apart on all other browsers.
During developing NOT testing I use this combo :
firefox
firebug extension
webdeveloper extension
live http headers extension
Give it a try, you won't regret it, you can make changes to your css IN BROWSER and then change your code (No more refresh needed for that one annoying one pixel offset), check to see where is the fault interface or code logic and plenty more.(Page Speed & YSlow to analize your page speed etc.)
I whole-heartedly agree with Pekka.
I develop everything within Firefox and use the excellent addons available during development (Firebug / Web Developer Toolbar / etc).
A suggestion would be to test often in other browsers as well....I would recommend every time you go to take a little break check it out in the other browsers to see if there are any issues, and then make a note to fix them and allow your website to be rendered properly in all browsers.
You really don't want to exclude any user based on his/her browser preference, so make sure
it works across the board!
edit
Also a good point from one of the other users...IE6 is in the process of being phased out, however if you are looking to have any users in a corporate environment you don't want to exclude testing this either!
You need to test your css in all the major browsers, that includes IE (6, 7 and 8), Firefox, Chrome and even Safari and Opera.
You can probably get away with just using the latest versions of Firefox, Chrome etc. as they auto-update and so users are less likely to be using older version (though it's not unknown).
IE is a problem because so many users - particularly corporate users - are running older versions.
Choose one, it doesn't really matter which as long as it has good development tool support, to develop in and get the site looking good in that. Then test in the others. Which order you do this and how much effort you want to expend will depend totally on your target audience. From my experience Firefox with Firebug and even (dare I say it) IE8 with it's built in developer tools are good choices. The advantage here is that you'll cover the majority of users with these. However as the browser market is getting more fragmented you will need to test in others.
This is an interesting question, I'm going to assume that you have a process that means that first you develop your page and then you do cross browser testing to make sure it works everywhere - so the question then becomes which one is going to get you to the best starting point for getting to working "everywhere" (definition of which will depend somewhat on your target audience).
This used to be easy - according to my (then) staff Firefox had good standards support and the best tools - so get it right in firefox first then adapt to cope with everything else, now its a lot less clear as IE8 has a very decent set of dev tools (and is better behaved than its predecessors) and Chrome is now getting into the act - again with a good set of tools and extensions.
My gut feeling is probably Firefox, Chrome, IE8 in that order - but I'm not doing anywhere near enough CSS work to assert that that's right.
You develop in Firefox (you have firebug to adjust things), you test in safari/chrome & opera (all of them is ok with standards so you have low chances to have bugs in those) and you debug in IE. Because is impossible to have a fully functional in ALL browser from one try :D
I use my main browser (Chrome) for basic progress, and frequently check all other browsers for bugs and layout problems.
I think If we choose firefox and IE 6.0 both for website design, the site will be look almost same for all browsers, because rest of IE 6 & 7 all browsers' HTML rendering pattern is almost same. So If we make css from start considering firefox and IE 6.0, bugs would be in less numbers and In this way we can make all browser compatible website.
Please give me feedback
I do it in ie6, the most primitive browser which is still in use.
I think any thing that will work on ie6 will work on any browser.

What's the best way to emulate a firebug workflow for css in IE6?

So I do quite a lot of CSS development, and I work with Firefox / Firebug A LOT. I generally know how to debug for IE6/IE7 (as far as techniques) and if I have the source, I can easily just edit the actual files and run a local server on a linux machine and test it in IE, going back and forth until it's fixed.
I find myself lately being asked to debug problems in IE6 when I don't have the source. Is there anyway to emulate a firebug like flow in IE6?
Firebug Lite doesn't allow you to change css values, nor does IETester. It doesn't necessarily have to be an inline tool (maybe there is some utility to quickly download 1 off webpages and their dependencies), but I'm definitely looking for the most productive solution to fixing bugs in IE when I don't have the source readily available to me.
Try the IE Dev Toolbar.
It's not as convenient or user-friendly as Firebug, but it can modify CSS and HTML attributes.
Firebug Lite is the best way to debug html in IE.
Firebug is an extension for Firefox,
but what happens when you need to test
your pages in Internet Explorer,
Opera, and Safari?
The solution is Firebug Lite, a
JavaScript file you can insert into
your pages to simulate some Firebug
features in browsers that are not
named "Firefox".
Firebug Lite creates the variable
"firebug" and doesn't affect or
interfere with HTML elements that
aren't created by itself.
Since you already know about it and it doesn't fit what you need, take a look at DebugBar. There is also a MS solution with Internet Explorer Developer Toolbar.
you have tryed Internet Explorer developer toolbar
Why, the IE developer toolbar of course!
It allows manipulation of HTML and CSS values.
3 solutions which i use always
Use IE 8 with developer toolbar in IE 7 emulation mode to solve problems of IE 7 and for IE 8 use in normal mode
for IE 6 it's best till date for me i use this a lot http://www.paciellogroup.com/blog/?p=7
and this to judge right selectors it's very good http://www.westciv.com/mri/ ( i use this for all browser, because it can tell perfect selector for element )
Firebug lite and IE developer toolbar on IE7 not much useful

Tools Debugging CSS in Internet Explorer

Are there tools other than Firebug Lite that might help one get into Internet Explorer's buggy little mind and find out precisely where and why it's mangling my CSS so badly?
Firebug Lite is a useful tool of course, but it seems to be missing the crucial feature (present in the 'full' Firebug plugin) that allows you to see which parts of which declarations are ignored in favor of other declarations.
For example, using Firefox with Firebug I can see that .foo {color: red} is overridden by .bar {color: blue} later in the stylesheet.
But, Firebug lite only seems to show the final, calculated style -- I can't tell which declarations are being ignored, which are being overridden, which aren't supported at all, and which are just plain buggy.
Is there another tool that might be helpful here?
I am using IE8 Developer Tools (which is included out of the box), it can show style tracing.
IE7 have also Microsoft-supplied add on called IE Dev Toolbar. Have not used this extensively though.
What version of IE are you using?
Yes. In IE8 hit F12. In previous versions, install this.
The developer tools included with IE8 works quite well.
I have found jQuery to be helpful in figuring out what's going on "under the hood" so to speak. For instance, I had a situation recently where I found that I could not trust the Developer Tools that come with IE 8 (which, by the way, I was running in IE 7, standards not quirks, compatibility mode. Some CSS properties declared in the stylesheet were not being shown as computed, in addition to other IE-strangess I was experiencing. So, I just threw some javascript on the page, including jQuery, which would allow me to type up some code and have it evaluated without relying on IE Developer Tools, Firebug or the Web Inspector in Safari. You can evaluate statements like:
$('body').css('background-image');
which might return:
'/images/default_background.png'
or whatever.
YMMV, but it's worth the time to try it.
I don't know if it has the ability to check specific css overriding, but I'd start out the Internet Explorer Developer toolbar
Another one is the Debug Bar. Works in IE 7 or 8; and is similiar to Firebug
You can use my new tool to view the layout of any element you can mouse over.
HTML Box Visualizer - GitHub

Resources