how to solve css style problems in all browsers like firefox, Safari , Internet-explorer ?

  Angular, HTML & CSS, Javascript

Some times your css code will not work in some browsers. its not big deal come lets see how to solve that… One thing before that check it your browser is updated or what. its very important

1.Firefox

Write CSS for anyone browser as you like (Google Chrome) the most.Find the class or id in which you are facing problem on the firefox browser.After finding the class or id you have to write some CSS code in your style sheet which is shown below.

//this will work for firefox
@-moz-document url-prefix(){
h1{
color:red;
}
}

2.Safari

Step 1: Write CSS for anyone browser as you like (Google Chrome) the most.

Step2: Find the class or id in which you are facing problem on the safari browser.

Step3: After finding the class or id you have to write some CSS code in your style sheet which is shown below.

@media screen and (-webkit-min-device-pixel-ratio:0) { 
/* Safari only override */ ::i-block-chrome, .seo-website
{
color:#000;
}
}

Don’t forget to write (-webkit-min-device-pixel-ratio:0) in the main media.(-webkit-min-device-pixel-ratio:0)This code is used to maintain the aspect ratio of your web page.

Don’t forget to write ::i-block-chrome this code next to every class.::i-block-chromeThis code is used to block your safari CSS Code in the chrome Browser.

3.Internet Explorer

Write CSS for anyone browser as you like (Google Chrome, Safari, Opera ,Firefox) the most.Find the class or id in which you are facing problem on the IE browser.After finding the class or id you have to write some CSS code in your style sheet which is shown below.

//this will work only in IE/Version Browsers
<!-- [if IE]>
<style>
#myId{
color:#000;
}
</style>
<![endif]-->
Spread the Code

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
prem karthi Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
prem karthi
Member

Good..