26
Practical Strategies for Debugging Cross-Browser Display Issues Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Embed Size (px)

Citation preview

Page 1: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Practical Strategies for Debugging Cross-Browser Display IssuesLori DirksExpression Community ManagerMicrosoft Corporation

SESSION CODE: WEB309

Page 2: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309
Page 3: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309
Page 4: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Planning for Cross-Browser Success

Identify troubleTest, test, test

Diagnose the situationKnow where the potential pitfalls are and what causes them

Correct courseTackle problems when they arise

Page 5: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Why Don’t More People Test?

Reasons include:Inconvenient

Interrupts workflow

HardHard to install different versions of browsers side-by-side

ExpensiveMultiple monitorsMultiple machinesMaintain multiple virtual PCs

Page 6: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

A New Tool in the Toolbox: SuperPreview

DEMO

Page 7: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

A New Tool in the Toolbox: SuperPreviewLocal Browsers

Firefox, installed versionsInternet Explorer 6Internet Explorer 7Internet Explorer 8 > 7 Compatibility ModeInternet Explorer 8

CompositionsImages and PSD Files

SuperPreview Beta Online ServiceMac Safari 4

Page 8: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

SuperPreview Debugging Tools

Identify troubleSide-by-side visual displayOnion skin overlay

Diagnose problems and causesElement highlightingPosition and size detailsDOM tree information

Page 9: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

A Practical Approach to Debugging

Three step process:

Identify display differences

Diagnose problems

Fix

(repeat)

Page 10: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

SuperPreview In Action

DEMO

Page 11: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Doubled Float-Margin

Issue: When you have a float with a margin specified in the same direction, IE6 doubles it

For example, a right float with margin-right:10px is displayed with a right margin of 20px

Solution:Apply display:inline to the elementChange the margin to padding

Page 12: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Conditional CommentsIt’s a good practice to put cross-browser code into conditional comments

For the doubled float-margin example:<!—[if IE 6]>

<link rel=“stylesheet” type=“text/css”href=“ie6.css” /><![endif]-->

ie6.css#aboutus {

display:inline;}

Page 13: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

SuperPreview In Action

DEMO

Page 14: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Expand-to-Fit Content

Issue: When content would otherwise overflow the container, IE6 expands the container to fit the content

If an element is specified larger than the containerIf an image is larger than the containerIf an unbreakable word exceeds the container size

Solution: depends on the underlying causeChange the element to fit the containerSet the container to overflow:hidden;Set a conditional comment to break very long words

Page 15: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

SuperPreview In Action

DEMO

Page 16: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

hasLayoutSuperPreview shows whether an element hasLayout or not, enabling you to try toggling the property to resolve issues

hasLayout is an IE6 and IE7 property that determines how elements: Draw and bound their content, Interact with other elements

Issues caused by having and not having layout include:Float display issuesList numbering and spacing discrepanciesBackground image positioning differences

Comprehensive discussion: On Having Layout, http://www.satzansatz.de/cssd/onhavinglayout.html

Page 17: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

SuperPreview In Action

DEMO

Page 18: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Common Cross-Browser Issues

DOCTYPE declarationAffects browser rendering choices

Doubled float-marginContent renders correctly, but is out of place

Expand-to-fit contentElements are larger than expected, or out of place

hasLayoutUnexpected rendering issues

Page 19: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

What’s Next

Try out SuperPreviewDownload the Expression Studio 4 Web Professional Trial (60 day trial), http://www.microsoft.com/expression/try-it

Identify, Diagnose, Correct

Stay out of the trees

Page 20: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Cross-Browser Resources

Chris Coyier’s CSS Tricks, IE CSS Bugs That’ll Get You Every Time, http://css-tricks.com/ie-css-bugs-thatll-get-you-every-time/

CSS Differences in Internet Explorer 6, 7, and 8, http://www.smashingmagazine.com/2009/10/14/css-differences-in-internet-explorer-6-7-and-8/

Position is Everything, http://positioniseverything.net

Page 21: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Track ResourcesASP.NET – http://www.asp.net/ Silverlight – http://silverlight/ Expression – http://www.microsoft.com/expression/ Internet Explorer – http://www.microsoft.com/windows/internet-explorer/default.aspx

Page 22: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Resources

www.microsoft.com/teched

Sessions On-Demand & Community Microsoft Certification & Training Resources

Resources for IT Professionals Resources for Developers

www.microsoft.com/learning

http://microsoft.com/technet http://microsoft.com/msdn

Learning

Page 23: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Complete an evaluation on CommNet and enter to win!

Page 24: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st

http://northamerica.msteched.com/registration

You can also register at the

North America 2011 kiosk located at registrationJoin us in Atlanta next year

Page 25: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 26: Lori Dirks Expression Community Manager Microsoft Corporation SESSION CODE: WEB309

JUNE 7-10, 2010 | NEW ORLEANS, LA