Finding Cross Browser Compatibility Issues in HTML and CSS
Tags: webdev, css, html, testing
Published: 2022-04-18 12:44:04


Cross browser compatibility bugs are inevitable for any web project irrespective of whatever platform they are using for development. And most importantly, they keep creeping in at every iteration.

Since it’s first inception, JavaScript has been the main culprit behind browser compatibility issues, as it was the fastest growing technology of the time. So fast that most browsers had to catch up to give support. However after new HTML5 standards, JS got a new partner in causing havoc. Since HTML and CSS are the simpler languages, people misunderstood them as not being the culprit for [cross browser compatibility issues](https://www.lambdatest.com/blog/10-ways-to-avoid-cross-browser-compatibility-issues/?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=blog). However, this doesn’t always hold true. Many times the smallest member of the house is the problematic one and may cause a lot of unknown issues.

So, this may be one of the main reason you need to handle them delicately. But, before you handle them you need to find out the errors first.

## Finding and Fixing General Problems

The major problems that usually went unnoticed by us are the most simpler ones. And these problems are so simple that they may pass through our eyes a hundred times and still we fail to figure them.

It’s just like *the* semicolon(;). Syntax errors are the highest cause of high pressure among web developers.

So, for CSS and HTML you don’t always need to go finding out the semicolon if you just use a validator for the same.

A validator may help you figure out some mistakes that seem so simple. For HTML, it validates the tags are closed and nested, a DOCTYPE is used, and tags are used correctly while for CSS it checks that the property names and values are spelled correctly, no curly braces are missed, and other CSS properties.

You can use W3C Markup validation service to validate your website’s HTML code or if you simply want to copy paste your HTML you can use [Free Formatter](https://www.freeformatter.com/html-validator.html) or [JS Formatter](https://jsonformatter.org/html-validator).

![](https://cdn-images-1.medium.com/max/2608/0*l50GhvwldAfX8GY0.png)

For CSS validation, you can use The W3C CSS Validation Service — W3 Jigsaw or CSS Validation Service.

![](https://cdn-images-1.medium.com/max/2608/0*Bdgd34v64NUexVUw.png)

These validators will help you figuring out the problems but if you also want to go ahead and know the bad practices that you’re using you may need to use a Linter. A linter not only points out the errors but it also flag up the warnings for your bad coding practices.

There are many linters available online for CSS, HTML, JS and other languages as well. The best of which are: Dirty Markup (for CSS, JS, HTML), CSS Lint( specially for CSS), JS Lint(for JS only).

![](https://cdn-images-1.medium.com/max/2000/0*4QSIeZruuD2u8PuZ.png)

Note: [Placeholder Image Generator](https://www.lambdatest.com/free-online-tools/placeholder-image-generator?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=free_tools) - A placeholder image is a visual representation of an idea or concept before the final image has been created. Designers commonly make use of “placeholder” images in an early design stage. Just enter the width and height of an image to generate it in either JPG or PNG format.

## Hunting Common Errors

Using validators and linters, you can beautify your code and figure out common problems but if you are on a hunt for finding the errors you can use one inbuilt feature in your [browser](https://www.lambdatest.com/?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=blog), ‘developer tools’.

This works well for CSS errors as HTML errors normally don’t tend to show up in dev tools as they try to cover them up by correcting badly formed markup automatically.

![](https://cdn-images-1.medium.com/max/2000/0*XlgH-4a1HxdHN2db.png)

You can find out errors as mentioned: Invalid property type.

These sort of errors may point out to be some of many reasons which causes cross browser incompatibility as some browsers do not support some specific CSS and HTML elements and you can go ahead for finding these elements.

This certification is for anyone who wants to stay ahead among professionals who are growing their career in Selenium automation testing.

Here’s a short glimpse of the Selenium 101 certification from LambdaTest:

{% youtube qx9FPFfJm7E %}

Note: [Random Password Generator](https://www.lambdatest.com/free-online-tools/random-binary-generator?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=free_tools) - Random Binary Generator generates random binary numbers of a specified length. It can be configured with the number of binary digits, and total digits wanted.

## Unsupported CSS Elements in Browsers

Older versions of Internet Explorer, one of still the most used browsers doesn’t support many CSS elements some of which are:

* CSS3 selectors

* CSS Counters

* CSS3 Box-sizing

* CSS font-stretch

* CSS namespaces

* CSS3 Colors

See full list of [unsupported CSS elements in all internet explorer browsers](https://caniuse.com/?compare=ie+6,ie+7,ie+8,ie+9,ie+10,ie+11&compareCats=all).

Similarly, some older Google Chrome versions doesn’t support the following CSS elements:

* CSS overscroll-behavior

* CSS display: contents

* CSS Paint API

* CSSOM Scroll-behavior

* CSS Scroll snap points

* CSS Conical Gradients

* CSS font-size-adjust

![*Unsupported CSS Elements in any latest chrome browsers*](https://cdn-images-1.medium.com/max/2424/0*0CVwt1v7isdaRGft.png)

<center>[Unsupported CSS Elements in any latest chrome browsers](https://www.lambdatest.com/blog/wp-content/uploads/2018/05/5-2.png)</center>



Similarly, you can check for any of the CSS elements that you are using in your website that what are the browsers that don’t support those elements. Unsupported CSS elements cause [cross browser compatibility](https://www.lambdatest.com/feature?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=blog) issues.

Note: [Random Character Generator](https://www.lambdatest.com/free-online-tools/random-character-generator?utm_source=devto&utm_medium=organic&utm_campaign=apr18_sd&utm_term=sd&utm_content=free_tools) - The Random Character Generator is an essential tool if you want to avoid patterns when generating a unique set of strings. The utility generates a sequence that doesn’t follow any recognizable pattern and is random.

## HTML Issues in Browsers

If you are willing to figure out the HTML issues, then the first and foremost thing to do is to check for the DOCTYPE. Have you used it?

And once you verify this, you need to make sure that you’re not using any of the third party code. Many times when you use a third-party code, you might find that the HTML generated by the third party app may be using class ID or Name that you’re using for a different purpose in your code. Hence that might a big problem and becomes hard to debug as it will not show any error however you’ll find the difference in the rendering of HTML causing cross-browser issues.

Many older versions of Internet explorer browser do not support HTML elements like:

* Video element

* Audio element

* Search input type

* Form validation

* Multiple file selection

* Offline web applications

See full list of unsupported HTML elements in all internet explorer browsers.

![*Unsupported CSS Elements in internet explorer browser*](https://cdn-images-1.medium.com/max/2404/0*BQMVPSN4579bOt6o.png)

<center>[Unsupported CSS Elements in internet explorer browser](https://www.lambdatest.com/blog/wp-content/uploads/2018/05/6.png)</center>


Go ahead, test your website across various browser combinations and figure out what went wrong, which unsupported CSS and HTML elements are you using in your website and now it’s turn to rectify them. Because it’s better late than never.