CSS codes for all browsers

CSS codes for all browsers

How to write code so that the appearance of the site can be seen regularly in all browsers? The use of gates provides this capability for you.


If you have any questions, ask!

How to write code so that the appearance of the site can be seen regularly in all browsers? The use of gates provides this capability for you.

Some websites do not look the same when viewed in different browsers. For example, in Google Chrome, the website is great, but in Mozilla, why is it messed up?

We have already explained about Cross Browser what it is and what it does, but in this article we want to look more specifically.

One of the reasons for the confusion of sites is the incompatibility of CSS codes with the browser. That is, the site designer did not pay attention to this point in coding or did not study the necessary syntaxes in relation to the standards of that code for different browsers, that's why this problem was created.

For example, if you want to use Flex code on your site, you need to know which versions of browsers support this code.

What to do for versions that are not supported? So let's go step by step

How to find out whether the browser supports CSS code or not?

To answer this question, one of the prominent sites in this field is w3schools . After entering this site, you enter the desired code in the search field and you will see which browser version supports the code.

How to find out whether the browser supports CSS code or not?

next question

How to optimize CSS codes for all browsers?

There are gates that are defined for each browser and by using them you can optimize that code for that particular browser. The gates are as follows:

-webkit- <!-- for Webkit browsers (chrome, Safari) -->
-moz- <!-- for FireFox -->
-o- <!-- for Opera -->
-ms- <!-- for Internet Explorer -->

As you can see above, each of the gates is for use in specific browsers, with a dash at the beginning and end.

  • webkit for use in Chrome and Safari browsers
  • moz for use in the Mozilla browser
  • o For use in the Opera browser
  • ms for use in Internet Explorer browser

Example :

Below we want to write a code that will make the background green, that is, for example, it will change a color from the right side to the left side.

background-image:     linear-gradient(right, #000, #FFF);

Normally, the code is written as above, but to display in Internet Explorer and Opera, the following codes must be added to the above code.

background-image:     -ms-linear-gradient(right, #000, #FFF); 
background-image:      -o-linear-gradient(right, #000, #FFF);

You can use Iteros online editor to check the codes .

Source » Itroz Academy

Related articles


White Screen of Death error in WordPress
The top WordPress theme design giants
The seventh training session of the WooCommerce management panel
The sixth training session of the WooCommerce management panel

Comments (0)

You need to login to post a comment.