{"id":85089,"date":"2019-05-30T12:20:08","date_gmt":"2019-05-30T17:20:08","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=85089"},"modified":"2024-10-02T11:02:20","modified_gmt":"2024-10-02T16:02:20","slug":"website-browser-compatibility","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/","title":{"rendered":"Creating Cross-Browser Compatible Websites"},"content":{"rendered":"\n<p>Even though most people stick to using a single browser, you have <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_web_browsers\" target=\"_blank\" rel=\"noreferrer noopener\">dozens of options<\/a> for both desktop and mobile devices. Ideally, websites would display perfectly regardless of which browser you used. However, that isn&#8217;t always the case, which is where cross-browser testing comes in.<br><\/p>\n\n\n\n<p>With thorough cross-browser testing, you can ensure that your website looks and behaves perfectly across all the popular options. That way, your visitors will have an equally great experience, whether they&#8217;re using <a href=\"https:\/\/www.google.com\/chrome\/\" target=\"_blank\" rel=\"noreferrer noopener\">Chrome<\/a>, <a href=\"https:\/\/www.mozilla.org\" target=\"_blank\" rel=\"noreferrer noopener\">Firefox<\/a>, <a href=\"https:\/\/www.opera.com\" target=\"_blank\" rel=\"noreferrer noopener\">Opera<\/a>, or less-known options such as <a href=\"http:\/\/www.seamonkey-project.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">SeaMonkey<\/a>.<br><\/p>\n\n\n\n<p>In this article, we&#8217;re going to talk a bit more about the importance of cross-browser testing. Then we&#8217;ll go over some steps to help you create a cross-browser compatible website. Here&#8217;s what we&#8217;ll cover:<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Why Is Cross-Browser Compatibility Important?<\/h2>\n\n\n\n<p>Most people use well-known browsers, such as Google Chrome, Safari, Firefox, and Opera. However, the are a lot more options available than you might imagine. This is good for the consumer, but the problem for you is that every browser is built differently. That means your website might work perfectly on Chrome, but experience issues on Firefox (just to give one example).<br><\/p>\n\n\n\n<p>In our experience, most of the errors you&#8217;ll see in one browser but not in another are relatively small issues. One specific element of your site may not look at it should, or a particular feature might not work correctly. While these problems can be minor, they need to be addressed if you want to provide the same experience to all of your site\u2019s visitors.<br><\/p>\n\n\n\n<p>Ideally, you\u2019ll want to design your website to be cross-browser compatible from the ground up. That way, you won&#8217;t risk alienating the users of any particular browser. In the next few sections, we\u2019ll show you how to do that.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Create a Cross-Browser Compatible Website<\/h2>\n\n\n\n<p>The idea of creating a cross-browser compatible website might sound daunting. However, a few simple steps can go a long way towards ensuring that your site works perfectly on most browsers. Let&#8217;s talk about what those are!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set a \u2018Doctype\u2019 for Your HTML Files<\/h3>\n\n\n\n<p>When a browser loads your website, it has to figure out what version of HTML you&#8217;re using. This is important, because different versions of HTML contain different rules.&nbsp;<br><\/p>\n\n\n\n<p>A <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/Doctype\" target=\"_blank\" rel=\"noreferrer noopener\">&#8216;doctype&#8217;<\/a> is a statement that tells browsers: &#8220;Hey, this is the version of HTML we&#8217;re going to use!&#8221; That way, browsers won&#8217;t have to make any guesses, which can diminish the number of errors your users will encounter.<br><\/p>\n\n\n\n<p>Fortunately, this step is remarkably simple. All you have to do is add the following snippet of code to your HTML documents:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE HTML PUBLIC \u201c-\/\/W3C\/\/DTD HTML 4.01\/\/EN\u201d<br>\u201chttp:\/\/www.w3.org\/TR\/html4\/strict.dtd\"&gt;<br><\/pre>\n\n\n\n<p>As you&#8217;ll notice, this snippet is for version 4.01 of HTML. If you want to use HTML5 instead, you can use this code:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE html&gt;<br><\/pre>\n\n\n\n<p>The problem is that some browsers still don&#8217;t <a href=\"https:\/\/html5test.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">play nicely with HTML5<\/a>. Despite its many improvements, using it <em>can<\/em> affect cross-browser compatibility, so you\u2019ll need to weigh that fact alongside its advantages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Use the CSS Reset Rules for Cross-Browser Compatibility <\/h3>\n\n\n\n<p>Usually, CSS is the main culprit behind browser compatibility errors. That\u2019s because each browser has its own set of CSS rules. To put it another way, your site&#8217;s CSS might render differently depending on which browser your visitors use.<br><\/p>\n\n\n\n<p>One way to solve this problem is to use a &#8216;CSS reset&#8217;. These are sets of rules you can add to your website, which set a baseline for the way CSS works across browsers.<br><\/p>\n\n\n\n<p>There are several options when it comes to CSS resets, but one of our favorites is called <a href=\"https:\/\/necolas.github.io\/normalize.css\/\" target=\"_blank\" rel=\"noreferrer noopener\">Normalize.css<\/a>, due to how comprehensive it is.<\/p>\n\n\n\n<p>You can download the <em>normalize.css <\/em>file from its GitHub library and use it as a starting point for your website&#8217;s CSS. This will help you maximize cross-browser compatibility on your site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Use Cross-Browser Compatible Libraries and Frameworks<\/h3>\n\n\n\n<p><a href=\"https:\/\/www.javascripting.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">JavaScript libraries<\/a> and broad frameworks such as <a href=\"https:\/\/foundation.zurb.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Foundation<\/a> and <a href=\"https:\/\/getbootstrap.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Bootstrap<\/a> are incredibly popular these days. If you&#8217;re going to use such elements to build your website, you can save yourself a lot of headaches by using cross-browser friendly options.<br><\/p>\n\n\n\n<p>Some libraries and frameworks were developed from the ground up to work with as many browsers as possible. Generally speaking, most popular frameworks \u2013 including the two we just mentioned \u2013 are built to be compatible with as many browsers as possible.&nbsp;<br><\/p>\n\n\n\n<p>Just to be safe, however, be sure to check the documentation for any library or framework you intend to use. In most cases, you&#8217;ll find information about cross-browser compatibility rather easily. For example, here&#8217;s <a href=\"https:\/\/foundation.zurb.com\/sites\/docs\/compatibility.html\" target=\"_blank\" rel=\"noreferrer noopener\">Foundation&#8217;s compatibility page<\/a> from its documentation.<\/p>\n\n\n\n<p>A little research will help you provide an amazing experience for all of your visitors, not just those who use a particular browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cross-Browser Compatibly Testing<\/h2>\n\n\n\n<p>Even if you&#8217;ve made an effort to create a cross-browser compatible website, it&#8217;s still a good idea to check and see if everything is working as it should. That process is relatively simple \u2013 all you have to do is load your website using multiple browsers and check for errors.<br><\/p>\n\n\n\n<p>The problem is that there are a <em>lot <\/em>of browsers out there. To cover your bases, we recommend that you focus on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Usage_share_of_web_browsers\" target=\"_blank\" rel=\"noreferrer noopener\">the top five options<\/a> according to market share, which are:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Google Chrome<\/li>\n\n\n\n<li>Safari<\/li>\n\n\n\n<li>Firefox<\/li>\n\n\n\n<li>UC Browser<\/li>\n\n\n\n<li>Opera<\/li>\n<\/ol>\n\n\n\n<p>You may notice that Microsoft Edge didn&#8217;t make the list. Its market share is rather small these days, but it&#8217;s still good practice to ensure that your site works with it as well.<br><\/p>\n\n\n\n<p>Of course, installing five or six different browsers on your computer can be a pain. That&#8217;s why there are a lot of services that enable you to <a href=\"https:\/\/www.slant.co\/topics\/1511\/~best-cloud-based-cross-browser-testing-services\" target=\"_blank\" rel=\"noreferrer noopener\">conduct cross-browser testing online<\/a>. This greatly simplifies the process, and the fees involved are usually minor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Achieve Cross Browser Compatibility: <br>Making Your WordPress Website Compatible with All Browsers<\/h2>\n\n\n\n<p>Not all of your website&#8217;s visitors will use the same browser. This means that if you want to make sure every user gets to enjoy your website, you\u2019ll need to do some cross-browser testing.<br><\/p>\n\n\n\n<p>Keep in mind, however \u2013 even if your site works perfectly across all browsers, you still need top-quality <a href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">hosting for your WordPress site<\/a> if you want to provide the best possible digital experience. With WP Engine, you get amazing performance and access to expert-level support, so <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">check out our plans<\/a>!<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Even though most people stick to using a single browser, you have dozens of options for both desktop and mobile devices. Ideally, websites would display perfectly regardless of which browser you used. However, that isn&#8217;t always the case, which is where cross-browser testing comes in. With thorough cross-browser testing, you can ensure that your website<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":297,"featured_media":146150,"template":"","resource-topic":[912],"resource-role":[896,906,897],"resource-type":[916],"class_list":["post-85089","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Build Cross-Browser Compatible Websites | WP Engine\u00ae<\/title>\n<meta name=\"description\" content=\"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Build Cross-Browser Compatible Websites | WP Engine\u00ae\" \/>\n<meta property=\"og:description\" content=\"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-02T16:02:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/05\/browser-header.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/\",\"name\":\"How To Build Cross-Browser Compatible Websites | WP Engine\u00ae\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2019-05-30T17:20:08+00:00\",\"dateModified\":\"2024-10-02T16:02:20+00:00\",\"description\":\"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating Cross-Browser Compatible Websites\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/3a22232b01de39dcf588fb8e421c0521\",\"name\":\"Erin Myers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"caption\":\"Erin Myers\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Build Cross-Browser Compatible Websites | WP Engine\u00ae","description":"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"How To Build Cross-Browser Compatible Websites | WP Engine\u00ae","og_description":"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2024-10-02T16:02:20+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/05\/browser-header.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/","name":"How To Build Cross-Browser Compatible Websites | WP Engine\u00ae","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2019-05-30T17:20:08+00:00","dateModified":"2024-10-02T16:02:20+00:00","description":"With the variety of options for browsers available today it is important to create a website that is cross-browser compatible.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/website-browser-compatibility\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"Creating Cross-Browser Compatible Websites"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/3a22232b01de39dcf588fb8e421c0521","name":"Erin Myers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","caption":"Erin Myers"}}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/05\/browser-grid.png","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Developer, Entrepreneur, Freelancer","topic":"<strong>Topics:<\/strong> Performance","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/85089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/146150"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=85089"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=85089"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=85089"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=85089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}