Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Internet Explorer - CSS CONDITIONAL Comments

Microsoft implemented conditional comments in their browser, which allow you to link a stylesheet that will be interpreted by a browser alone.



You can also target only a certain version of IE:
















While conditional comments are better, we can also target some versions of Internet Explorer using the following syntax:
.class {
  width:200px; /* All browsers */
  *width:250px; /* IE */
  _width:300px; /* IE6 */
  .width:200px; /* IE7 */
}
Since this technique is not W3C compliant,conditional comments is best option. For more details please refer Microsoft official documentation -
http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx

How to RESET Default CSS Styles set by browsers

Web browsers define different default styling for html elements, the first thing to do is to always include a CSS reset in your stylesheet. By using this code, you're already eliminating lots of future headaches.

html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input,hr {margin:0; padding:0;}
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th {font-size:1em; font-weight:normal; font-style:normal;}
ul,ol {list-style:none;}
fieldset,img,hr {border:none;}
caption,th {text-align:left;}
table {border-collapse:collapse; border-spacing:0;}
td {vertical-align:top;}