Some Most Common Browser Compatibility Issues

Posted By : Prachi Ahuja | 24-Apr-2018

There are so many browser options for internet users. But it creates a problem for designers and developers who need to their make website compatible with all these browsers. Solving these cross-browser compatibility issues can be a tough task. Let's have a look at some compatibility issues and find a solution for some of these issues.

 

1. Incorrect or No Doctype
 The Doctype should be the first line of your code.
<!DOCTYPE html>
This single line of code can make a large difference in your website.So if your website acts differently in any browser re-check your doctype first!


2. No CSS Reset
Every browser comes with different set of CSS due to which browser will render your website page differently even if that browser lacks some CSS styles of its own. So to avoid such issues we can use CSS reset stylesheets.
Some of the common CSS  reset stylesheets are-

  • Normalize.css
  • HTML5Reset
  • Eric Meyers CSS Reset

 

3. Vendor Specific CSS Styles
Let's have a look at opacity property of CSS for Mozilla and without using Vendor specific prefix-?

        -moz-opacity: 0.6;

         opacity: 0.6;        
        

So every time make it sure that the code must work in all the browser to be fully compatible.The Prefix used for different browsers are:

-ms for Microsoft (Internet Explorer)
-moz for Mozilla Foundation (Firefox)
-o for Opera Software
-webkit  for Safari and Chrome

Therefore declaration of CSS property for all browsers will look like-

        .check{
         -moz-opacity: 0.6;
         -ms-opacity: 0.6;
         -webkit-opacity: 0.6;
         -o-opacity:0.6;
         opacity: 0.6;
        }       
        

4.Tips and tricks
The most important tips for every new and experienced developer are-

  • Understand the difference between block and inline elements.
  • Understand the effects of floating and clearing.
  • Understand box model in CSS.
  • Use reset property in CSS.

 

5.Css box model 
The CSS box model has some basic rules: 
     • Block-level elements are rectangular.
     • The dimensions of these block-level elements are calculated by using height, width, padding, margins, and borders.
     • If height is not specified, then a block level element will be high in accordance with the content it contains, plus padding.
     • If the width is not specified, a non-floated box will expand so as to fit the width of its parent element minus padding.


6.Multi-Column Layout
For multi-column layouts which are easy to maintain, using float property is the best method. Having a good understanding of how floats property work is, 
an important factor in achieving a cross-browser compatibility.


7. Some common issues
Let's see some most common problems 
     •IE6(Internet Explorer) will become problematic if CSS float property is overused
     •IE6(Internet Explorer) will double the margin value on the floated elements and setting display: inline property will solve this issue.
     •In IE6 and IE7(Internet Explorer), if an element doesn’t have a proper layout, it can cause many problems, including backgrounds invisible, margins              collapsing improperly,  and many more.
     •IE6(Internet Explorer) does not support minimum and maximum-based CSS properties like max-height, or min-width.
     •IE6(Internet Explorer) does not support fixed position property of background images.
     •IE6 and IE7(Internet Explorer) do not support any alternate values for the display property of CSS. 
     •The: hover pseudo-class cannot be used on any element in IE6 except an anchor tag (<a>).
     •Some versions of IE have less support for certain selectors (e.g. child selectors) 
     •IE versions 6-8 have very little support for CSS3.

About Author

Author Image
Prachi Ahuja

Prachi is a UI Developer having knowledge of HTML5, CSS3, Javascript, Jquery. She is dedicated towards her work.Her hobbies are drawings/paintings and writing articles.

Request for Proposal

Name is required

Comment is required

Sending message..