Learn How to create Compatible CSS for Various Browsers like Internet Explorer 6 , IE7 , IE8 , Opera , Firefox , etc..
Web-designers create blogger template for Hours using one particular browser say Firefox , They don't know that the CSS code they use is compatible only for the browser they are working at present. Especially in IE6 , there are many Compatible issues.
for Example : the sidebar may appear below main content wrapper or there would be more gap between each widget , content wrapper and sidebar may overlap ,etc.
So in this Post I will tell you How to create CSS code which is compatible for almost all browsers. For this you need to have two browsers Internet Explorer 6 and Firefox .
I have chose IE6 because it is one of the most common browsers which windows have.
First let's check is our current Blogger template is compatible with all browsers or not.
For this visit this website : Browser Screen shots
Enter your Blog URL and check the images there to know How your blog looks in various Browsers.
step 2 : If you find any incompatibility issues then you need to modify your CSS code to suit browsers.
Let's us see an Example
Generally the css we use if of this form :
#example {
float : left;
width : 170px;
margin-left : 5px;
}
In this assume that this particular div is incompatible with Internet Explorer version x.
then we need to modify the above css code as
#example {
float : left;
width : 170px;
margin-left : 5px;
}
#example {
float : left;
width : 185px;
margin-left : 3px;
}
in this first css code is for all versions of Internet Explorer and the second css code is for other browsers like firefox , opera , dillo , sea monkey , etc
but it will be confusing for you to edit.. so now we are going to add different CSS rules to IE, we can use the child selector command which IE can't understand. The child selector command involves two elements, one of which is the child of the other. So, html>body refers to the child, body, contained within the parent, html.
After introducing Child selector command , the css code must look like this
#example {
float : left;
width : 170px;
margin-left : 5px;
}
html > body #example {
width : 185px;
margin-left : 3px;
}
in this the green colored code is for IE versions and the red Colored code is for other browsers.
So with simple child selector command we can make our css code compatible for all browsers. Every time when I create a New template , I use to check whether it is compatible with other browsers or not. And I use to change the CSS code to suit that browser.
If you are unable to modify the CSS code then please mail me your template and explain the problem , I will rectify those errors and mail you back.
0 yorum:
Yorum Gönder
Yorum Yazarken Türkçemizi Doğru Kullanalım!