4 ms·
After too many years of doing this, this is the best advice I can give: The most common issues are inconsistent spacing between elements. Don't try to understan
by erlanger 17y ago
After too many years of doing this, this is the best advice I can give: The most common issues are inconsistent spacing between elements. Don't try to understand why this may be, instead, use padding if margin isn't working, vice versa otherwise, and move the layout to another equivalent element (simple wrapper, etc.) if you run into a really sticky problem.
This has solved about 90% of the CSS-related cross-browser layout problems I've experienced.
Do not use hacks unless you absolutely must!
You should never need to target a non-Microsoft browser. When you need to target IE,
* html selector (IE6-inclusive)
and
html:not([dummy]) selector (IE7-exclusive)
Even though they work, these are for last resorts and should pretty much never be used. Most of the time that I see a cross-browser hack used, it really was due to the author's poor understanding of the CSS issue at hand and would've been corrected with good defensive styling using simple, well-supported styles.
- sync 17y agoYep, I agree. 90% of these hacks really aren't necessary at all. Another thing to consider is that your site doesn't need to look 100% the same across all browsers -- allow room for leeway, and you won't be pulling your hair out nearly as much. IE6 isn't as bad as y'all make it out to be. Sure, we can't use fancy CSS3 selectors or HTML5, but you can't on IE7 or 8 either...
- erlanger 17y agoI've always promised the designers pixel perfection across browsers, but I agree that for a casual site it's OK to leave some aspects of typography to the browser defaults, and to fudge layouts with uncalculated "em" spacing.