SlideShare a Scribd company logo
Cross Browser Issues - few solutions inspired by smashing magazine
It is arguable that there is no goal in web design more satisfying
than getting a beautiful and intuitive design to look exactly the
same in every currently-used browser.
Creating a consistent experience for every user in every browser
(putting aside mobile platforms for the moment) is never going to
happen for every project
A near-exact cross-browser experience is attainable in many cases.
Most important principles and tips that can help both new and
experienced front-end developers achieve as close to a consistent
cross-browser experience as possible
1. The Problem
2. Understand the CSS Box Model
3. Understand the Difference Between Block and Inline
4. Understand Floating and Clearing
5. Use Internet Explorer First (Or Don’t)
6. Understand Internet Explorer’s Most Common Problems
7. Some Things Will Never Look the Same
8. Use a CSS Reset
9. Validate
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazine
Not everyone uses the same browser. Similar to how everyone is
running on a different operating system, you can’t expect all people to
be using the same web browsing tool.
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazine
This is one of the first things you should be thoroughly familiar with if
you want to be able to achieve cross-browser layouts with very few
hacks and workarounds.

• The box model is not a difficult thing to grasp
• Generally works the same in all browsers
• Except in circumstances related to certain versions of Internet Explorer
The CSS box model is responsible for calculating:
•
•
•
•

How much space a block-level element takes up
Whether or not borders and/or margins overlap, or collapse
A box’s dimensions
To some extent, a box’s position relative to other content on the page
The CSS box model has the following basic rules:

• Block-level elements are essentially rectangular (as are all elements,
really)
• The dimensions of a block element are calculated by width, height,
padding, borders, and margins
• If no height is specified, a block element will be as high as the content it
contains, plus padding (unless there are floats, for which see below)
• If no width is specified, a non-floated box will expand to fit the width of
its parent minus padding
Some important things to keep in mind for dealing with block-level
elements:
• If a box has its width set to “100%”, it shouldn’t have any margins,
padding, or borders, otherwise it will overflow its parent
• Vertically-adjacent margins can cause some complex collapsing
issues that may cause layout problems
• Elements positioned relatively or absolutely will behave differently,
the details of which are extensive
• The rules and principles above are stated under the assumption that
the page holding the block-level elements is rendered in standards
mode
Cross Browser Issues - few solutions inspired by smashing magazine
Another crucial area that, when fully understood, will cause the light
bulb to appear, many headaches will be avoided, and you’ll feel much
more confident in creating cross-browser layouts.
Here are some basic rules that differentiate block elements from inline:
•Block elements will, by default, naturally expand horizontally to fill their
parent container, so there’s no need to set a width of “100%”
•Block elements will, by default, begin at the leftmost edge of the parent
box, below any previous block elements (unless floats or positioned
elements are utilized; see below)
•Inline elements will ignore width and height settings
•Inline elements flow with text, and are subject to typographical properties
such as white-space, font-size, and letter-spacing
•Inline elements can be aligned using the vertical-align property, but block
elements cannot
•Inline elements will have some natural space below them in order to
accommodate text elements that drop below the line (like the letter “g”)
•An inline element will become a block element if it is floated
Cross Browser Issues - few solutions inspired by smashing magazine
For multi-column layouts that are relatively easy to maintain, the best
method is to use floats. Having a solid understanding of how floats
work is, therefore, another important factor in achieving a cross-browser
experience.
Floated element can be floated either left or right, with the result that the
floated element will shift in the specified direction until it reaches the edge
of its parent container, or the edge of another floated element.
Some important things to keep in mind when floating and clearing
elements:
• Floated elements are removed from the flow of other block-level, nonfloated elements; so in other words, if you float a box left, a trailing
paragraph (block level) that’s not floated will appear behind the float in
the stack, and any text inside the paragraph (inline level) will flow
around the float
• To get content to flow around a floated element, it must be either
inline or else floated in the same direction
• A floated element without a declared width will shrink to the width of
its content, so it’s generally best to have a set width on a float
• If a block element contains floated children, it will “collapse”, requiring
a fix
• An element that’s “cleared” will avoid flowing around floated elements
above them in the document
• An element that’s both cleared and floated will only clear itself of
elements that come before, not after
Cross Browser Issues - few solutions inspired by smashing magazine
Sites and Applications should be developed in “modern” webbrowsers, with standards first and then be tweaked for buggy versions
of Internet Explorer.

Although we might hate to use IE6 and IE7 in our everyday internet
activities, when it comes time to build a client project from scratch,
one of the best things you can do is test your layout in those browsers
early in development.
It’s much easier to get a layout working first in IE6 and IE7, Waiting
until late in the development process to open up IE6 and/or IE7 will
likely cause some, if not all, of the following problems:

• Multiple hacks will be required, needing separate style-sheets for
different versions of IE, making the code bloated and less
maintainable and making the website slower
• The layout in some spots may have to be reworked, multiplying
development time
• Testing time will increase, sometimes exponentially, leaving less
time for more important tasks
• The layout in other browsers will not be the same as in IE6 and IE7
Dealing with IE is a fact of life for designers and developers, so just
view its problems as you would any CSS issue — and build from there.
Cross Browser Issues - few solutions inspired by smashing magazine
If you’re going to start with IE in your development, or at the very least
check your layout in IE early on, then you should understand what things
Internet Explorer (usually versions 6 & 7) has problems with, or what its
limitations are.
Here is a rundown of the most common problems you’ll need to deal
•IE6 will become problematic if floats are overused, causing
with:
(paradoxically)disappearing content or duplicate text
•IE6 will double the margin on floated elements on the side that is the same
direction as the float; setting display: inline will often fix this
•In IE6 and IE7, if an element doesn’t have layout, it can cause a number of
problems, including backgrounds not showing up, margins collapsing
improperly, and more
•IE6 does not support min- and max-based CSS properties like min-height,
or max-width
•IE6 does not support fixed positioning of background images
•IE6 and IE7 do not support many alternate values for the display property
(e.g. inline-table, table-cell, table-row, etc.)
•You cannot use the :hover pseudo-class on any element in IE6 except an
anchor (<a>)
•Certain versions of IE have little support for certain CSS selectors (e.g.
attribute selectors, child selectors, etc.)
•IE versions 6-8 have little support for CSS3, but there are some workarounds
Cross Browser Issues - few solutions inspired by smashing magazine
As already mentioned, creating the exact same experience visually and
functionally in every browser is possible, but unlikely.
You can get the layout and positioning of elements close to pixel-perfect,
but there are some things that are out of the developer’s control.
Forms will often look different
Typography will always look different
Use CSS reset
Use Prefixr
Validate both html and css as you develop
Thank you

More Related Content

PPTX
Role of Design in Accessibility — VilniusJS Meet-up
PPTX
Selfish Accessibility — YGLF Vilnius
PPTX
The Role of Design in Accessibility — a11yTO Meet-up
KEY
The web standards gentleman: a matter of (evolving) standards)
PPT
Ppt ch11
PPT
Ppt ch01
PPTX
BASICS OF HTML
Role of Design in Accessibility — VilniusJS Meet-up
Selfish Accessibility — YGLF Vilnius
The Role of Design in Accessibility — a11yTO Meet-up
The web standards gentleman: a matter of (evolving) standards)
Ppt ch11
Ppt ch01
BASICS OF HTML

What's hot (14)

PPTX
Web development basics
PPTX
Module 3 - Intro to Bootstrap
PPTX
LIBRARIANS AS WEB DEVELOPERS: GAUGING THE BEST TECHNOLOGIES IN ACCESSING INFO...
PDF
DrupalCon Austin 2014 Implement Foundation or Other Front-End Frameworks in Y...
PDF
Web Accessibility for the 21st Century
PPTX
Castro Chapter 3
PPTX
Artistic Web Applications - Week3 - Part 1
PPTX
HTML Start Up - Introduction to HTML
PPTX
Artistic Web Applications - Week3 - Part 3
PPTX
WordPress Blogs 101
PPT
Ppt ch08
PPTX
LecWeek2 lecture-whatiswebdesign-part2
PPTX
Accessibility 101
PPTX
Driving SharePoint End-User Adoption: Usability and Performance
Web development basics
Module 3 - Intro to Bootstrap
LIBRARIANS AS WEB DEVELOPERS: GAUGING THE BEST TECHNOLOGIES IN ACCESSING INFO...
DrupalCon Austin 2014 Implement Foundation or Other Front-End Frameworks in Y...
Web Accessibility for the 21st Century
Castro Chapter 3
Artistic Web Applications - Week3 - Part 1
HTML Start Up - Introduction to HTML
Artistic Web Applications - Week3 - Part 3
WordPress Blogs 101
Ppt ch08
LecWeek2 lecture-whatiswebdesign-part2
Accessibility 101
Driving SharePoint End-User Adoption: Usability and Performance
Ad

Similar to Cross Browser Issues - few solutions inspired by smashing magazine (20)

PDF
CSS 201
PDF
University of Portsmouth Library: A practical approach to Responsive Design
PDF
Web Concepts_PageLayouts in website design.pdf
PDF
Dangerous CSS
PPTX
Html presentation
PPTX
Mobile Best Practices
PDF
Accessibility for Fun and Profit
PDF
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
PPTX
Advanced CSS.pptx
PPTX
Making Your Site Printable: CSS Summit 2014
PPTX
Reboot-Typography.pptx reboot typography to help you in research
PPTX
Bootstrap for Beginners
PDF
Architecting with Style
PPTX
HTML5- Create divisions in a web page
PPT
Advance Css
PPT
Advance Css 1194323118268797 5
PPT
Html5 basics
PDF
Code &amp; design your first website (3:16)
PPTX
Week 8 - Interactive News Editing and Producing
PDF
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
CSS 201
University of Portsmouth Library: A practical approach to Responsive Design
Web Concepts_PageLayouts in website design.pdf
Dangerous CSS
Html presentation
Mobile Best Practices
Accessibility for Fun and Profit
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Advanced CSS.pptx
Making Your Site Printable: CSS Summit 2014
Reboot-Typography.pptx reboot typography to help you in research
Bootstrap for Beginners
Architecting with Style
HTML5- Create divisions in a web page
Advance Css
Advance Css 1194323118268797 5
Html5 basics
Code &amp; design your first website (3:16)
Week 8 - Interactive News Editing and Producing
Adjusting to Auto Layout (Tutorial / Tips for iOS Auto Layout)
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PPTX
Machine Learning_overview_presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25-Week II
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Machine Learning_overview_presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf

Cross Browser Issues - few solutions inspired by smashing magazine

  • 2. It is arguable that there is no goal in web design more satisfying than getting a beautiful and intuitive design to look exactly the same in every currently-used browser.
  • 3. Creating a consistent experience for every user in every browser (putting aside mobile platforms for the moment) is never going to happen for every project A near-exact cross-browser experience is attainable in many cases.
  • 4. Most important principles and tips that can help both new and experienced front-end developers achieve as close to a consistent cross-browser experience as possible 1. The Problem 2. Understand the CSS Box Model 3. Understand the Difference Between Block and Inline 4. Understand Floating and Clearing 5. Use Internet Explorer First (Or Don’t) 6. Understand Internet Explorer’s Most Common Problems 7. Some Things Will Never Look the Same 8. Use a CSS Reset 9. Validate
  • 7. Not everyone uses the same browser. Similar to how everyone is running on a different operating system, you can’t expect all people to be using the same web browsing tool.
  • 10. This is one of the first things you should be thoroughly familiar with if you want to be able to achieve cross-browser layouts with very few hacks and workarounds. • The box model is not a difficult thing to grasp • Generally works the same in all browsers • Except in circumstances related to certain versions of Internet Explorer
  • 11. The CSS box model is responsible for calculating: • • • • How much space a block-level element takes up Whether or not borders and/or margins overlap, or collapse A box’s dimensions To some extent, a box’s position relative to other content on the page
  • 12. The CSS box model has the following basic rules: • Block-level elements are essentially rectangular (as are all elements, really) • The dimensions of a block element are calculated by width, height, padding, borders, and margins • If no height is specified, a block element will be as high as the content it contains, plus padding (unless there are floats, for which see below) • If no width is specified, a non-floated box will expand to fit the width of its parent minus padding
  • 13. Some important things to keep in mind for dealing with block-level elements: • If a box has its width set to “100%”, it shouldn’t have any margins, padding, or borders, otherwise it will overflow its parent • Vertically-adjacent margins can cause some complex collapsing issues that may cause layout problems • Elements positioned relatively or absolutely will behave differently, the details of which are extensive • The rules and principles above are stated under the assumption that the page holding the block-level elements is rendered in standards mode
  • 15. Another crucial area that, when fully understood, will cause the light bulb to appear, many headaches will be avoided, and you’ll feel much more confident in creating cross-browser layouts.
  • 16. Here are some basic rules that differentiate block elements from inline: •Block elements will, by default, naturally expand horizontally to fill their parent container, so there’s no need to set a width of “100%” •Block elements will, by default, begin at the leftmost edge of the parent box, below any previous block elements (unless floats or positioned elements are utilized; see below) •Inline elements will ignore width and height settings •Inline elements flow with text, and are subject to typographical properties such as white-space, font-size, and letter-spacing •Inline elements can be aligned using the vertical-align property, but block elements cannot •Inline elements will have some natural space below them in order to accommodate text elements that drop below the line (like the letter “g”) •An inline element will become a block element if it is floated
  • 18. For multi-column layouts that are relatively easy to maintain, the best method is to use floats. Having a solid understanding of how floats work is, therefore, another important factor in achieving a cross-browser experience.
  • 19. Floated element can be floated either left or right, with the result that the floated element will shift in the specified direction until it reaches the edge of its parent container, or the edge of another floated element.
  • 20. Some important things to keep in mind when floating and clearing elements: • Floated elements are removed from the flow of other block-level, nonfloated elements; so in other words, if you float a box left, a trailing paragraph (block level) that’s not floated will appear behind the float in the stack, and any text inside the paragraph (inline level) will flow around the float • To get content to flow around a floated element, it must be either inline or else floated in the same direction • A floated element without a declared width will shrink to the width of its content, so it’s generally best to have a set width on a float • If a block element contains floated children, it will “collapse”, requiring a fix • An element that’s “cleared” will avoid flowing around floated elements above them in the document • An element that’s both cleared and floated will only clear itself of elements that come before, not after
  • 22. Sites and Applications should be developed in “modern” webbrowsers, with standards first and then be tweaked for buggy versions of Internet Explorer. Although we might hate to use IE6 and IE7 in our everyday internet activities, when it comes time to build a client project from scratch, one of the best things you can do is test your layout in those browsers early in development.
  • 23. It’s much easier to get a layout working first in IE6 and IE7, Waiting until late in the development process to open up IE6 and/or IE7 will likely cause some, if not all, of the following problems: • Multiple hacks will be required, needing separate style-sheets for different versions of IE, making the code bloated and less maintainable and making the website slower • The layout in some spots may have to be reworked, multiplying development time • Testing time will increase, sometimes exponentially, leaving less time for more important tasks • The layout in other browsers will not be the same as in IE6 and IE7
  • 24. Dealing with IE is a fact of life for designers and developers, so just view its problems as you would any CSS issue — and build from there.
  • 26. If you’re going to start with IE in your development, or at the very least check your layout in IE early on, then you should understand what things Internet Explorer (usually versions 6 & 7) has problems with, or what its limitations are.
  • 27. Here is a rundown of the most common problems you’ll need to deal •IE6 will become problematic if floats are overused, causing with: (paradoxically)disappearing content or duplicate text •IE6 will double the margin on floated elements on the side that is the same direction as the float; setting display: inline will often fix this •In IE6 and IE7, if an element doesn’t have layout, it can cause a number of problems, including backgrounds not showing up, margins collapsing improperly, and more •IE6 does not support min- and max-based CSS properties like min-height, or max-width •IE6 does not support fixed positioning of background images •IE6 and IE7 do not support many alternate values for the display property (e.g. inline-table, table-cell, table-row, etc.) •You cannot use the :hover pseudo-class on any element in IE6 except an anchor (<a>) •Certain versions of IE have little support for certain CSS selectors (e.g. attribute selectors, child selectors, etc.) •IE versions 6-8 have little support for CSS3, but there are some workarounds
  • 29. As already mentioned, creating the exact same experience visually and functionally in every browser is possible, but unlikely.
  • 30. You can get the layout and positioning of elements close to pixel-perfect, but there are some things that are out of the developer’s control.
  • 31. Forms will often look different
  • 32. Typography will always look different
  • 35. Validate both html and css as you develop