compatibility snippets

Reset CSS rules to render HTML identically in all browsers

Tagged css, reset, browser, compatibility  Languages css

These CSS rules remove most, if not all, browser specific styles from common HTML elements. Your page will look almost identical in all browser when using these CSS rules. Note that this is a combination of Tantek Celik's undohtml.css and YUI's reset.css.

/** START BLATANT RIP FROM Tantek Celik's undohtml.css */

/* link underlines tend to make hypertext less readable, 
   because underlines obscure the shapes of the lower halves of words */
:link,:visited { text-decoration:none }

/** END BLATANT RIP FROM Tantek Celik's undohtml.css */

/** START BLATANT RIP FROM YUI's reset.css */

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {  
  margin:0; 
  padding:0; 
} 
table { 
  border-collapse:collapse; 
  border-spacing:0; 
} 
fieldset,img {  
  border:0; 
} 
address,caption,cite,code,dfn,em,strong,th,var { 
  font-style:normal; 
  font-weight:normal; 
} 
ol,ul { 
  list-style:none; 
} 
caption,th { 
  text-align:left; 
} 
h1,h2,h3,h4,h5,h6 { 
  font-size: 1em; 
  font-weight:normal; 
} 
q:before,q:after { 
  content:''; 
} 
abbr,acronym { 
  border:0; 
} 

/** START BLATANT RIP FROM YUI's reset.css */

How to fix 80% of IE browser issues

Tagged internet explorer, html, bug, ie, compatibility  Languages 

Tell IE to use standards mode, not quirks mode

Define your doctype in your HTML:

<!DOCTYPE> element

See: https://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

Tell IE to not use compatibility mode

This prevents, for example, IE 11 from using IE 7 rendering mode which can happen for many reasons.

If you can’t add an HTTP header, then add this to your HTML and pray that it helps:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

IE is using a compatibility mode if you see “compatible; MSIE” in the user agent header:

"Mozilla/4.0 (compatible; MSIE 7.0;"

See:

Validate your HTML and CSS

https://validator.w3.org/

Use an IE hack

Try “zoom” or “!important”.