CSS hacks are one of the most popular tricks used in today's web2.0 time. This CSS hacks is mainly use for web pages to view the exact format in all latest and old browsers. The main use behind using these tricks is all browsers take padding - margins differently and to make it equal for all browsers we use CSS Hacks.
First Hack
<style type="text/css"> .cssstyle{ font-size:12px; //font-size:13px; } </style>
Now just put ‘//’ in front of css declaration, and a different browser will treat this as comment but Internet Explorer will not treat this as comment and display the font-size as 13px. “
” All Browsers Hack
<p><br /> <div class="cssstyle">Now the font-size would be 13px in IE and 12px in other browsers.</div></p> <p><style type="text/css"> <br /> <br /> #cssstyle {font-weight:bold; font-size:12px; color:black; voice-family:"\"}\""; voice-family:inherit; color:orange;}<br /> <br /> html*#cssstyle {[color:red; color:blue; ]color:purple;}<br /> <br /> * html #cssstyle {color:pink;}</p> <p></style></p>
“” Now, how to view in all browsers:
Now if your text comes in red color in which you used css class "cssstyle" it means you are using old browser like Opera or Mozilla!
Now if your text comes in orange color in which you used css class "cssstyle" it means you are using newer Standarized browser like Opera or Mozilla!
Now if your text comes in purple color in which you used css class "cssstyle" it means you are using Internet Explorer 7!
Now if your text comes in pink color in which you used css class "cssstyle" it means you are using Internet Explorer 6!
Now if your text comes in black color in which you used css class "cssstyle" it means you are using Internet Explorer 5!
And Blue color is used for Opera browsers. You can change the properties according to your use.