{"id":54,"date":"2013-01-07T22:42:38","date_gmt":"2013-01-07T22:42:38","guid":{"rendered":"http:\/\/www.pawebgate.com\/blogging\/?p=54"},"modified":"2013-01-24T14:48:00","modified_gmt":"2013-01-24T14:48:00","slug":"ie-specific-styling","status":"publish","type":"post","link":"https:\/\/www.pawebgate.com\/blogging\/ie-specific-styling\/","title":{"rendered":"IE Specific Styling"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-66\" title=\"ie vs mozilla\" alt=\"ie vs firefox\" src=\"http:\/\/www.pawebgate.com\/blogging\/wp-content\/uploads\/2013\/01\/ie-fox.jpg\" width=\"232\" height=\"217\" \/><\/p>\n<p>The key to create IE specific styling is called <strong>conditional stylesheet<\/strong>.<strong>\u00a0<\/strong><\/p>\n<p>IE provides comment tags, supported all the way up to the current IE 8 to target specific versions, as well as greater-than\/less-than stuff for targeting multiple versions at once.<\/p>\n<h3>Why use conditional stylesheets?<\/h3>\n<ul>\n<li>You got problems, they need fixin&#8217;<\/li>\n<li>Keeps your code hack-free and valid<\/li>\n<li>Keeps your main stylesheet clean<\/li>\n<li>Perfectly acceptable technique, sanctioned by Microsoft<\/li>\n<\/ul>\n<p>And remember, these conditional tags don&#8217;t have to be used only for CSS. You could load JavaScript, or even use them down in the content of your site to display special IE-specific messages.<!--more--><\/p>\n<h3>The Code<\/h3>\n<p>This would go in your &lt;head&gt; with all the other regular CSS &lt;link&gt;ed CSS files. The opening and closing tags should be familiar, that&#8217;s just regular ol&#8217; HTML comments. Then between the brackets, &#8220;IF&#8221; and &#8220;IE&#8221; should be fairly obvious. The syntax to note is &#8220;!&#8221; stand for &#8220;not&#8221;, so !IE means &#8220;not IE&#8221;. <tt>gt<\/tt> means &#8220;greater than&#8221;, <tt>gte<\/tt> means &#8220;greater than or equal&#8221;, <tt>lt<\/tt> means &#8220;less than&#8221;, <tt>lte<\/tt> means &#8220;less than or equal.&#8221;<\/p>\n<h4>Target ALL VERSIONS of IE<\/h4>\n<pre><code>&lt;!--[if IE]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"all-ie-only.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target everything EXCEPT IE<\/h4>\n<pre><code>&lt;!--[if !IE]&gt;&lt;!--&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"not-ie.css\" \/&gt;\r\n &lt;!--&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 7 ONLY<\/h4>\n<pre><code>&lt;!--[if IE 7]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7.css\"&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 6 ONLY<\/h4>\n<pre><code>&lt;!--[if IE 6]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie6.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 5 ONLY<\/h4>\n<pre><code>&lt;!--[if IE 5]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie5.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 5.5 ONLY<\/h4>\n<pre><code>&lt;!--[if IE 5.5000]&gt;\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie55.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 6 and LOWER<\/h4>\n<pre><code>&lt;!--[if lt IE 7]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie6-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if lte IE 6]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie6-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 7 and LOWER<\/h4>\n<pre><code>&lt;!--[if lt IE 8]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if lte IE 7]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 8 and LOWER<\/h4>\n<pre><code>&lt;!--[if lt IE 9]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie8-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if lte IE 8]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie8-and-down.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 6 and HIGHER<\/h4>\n<pre><code>&lt;!--[if gt IE 5.5]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie6-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if gte IE 6]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie6-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 7 and HIGHER<\/h4>\n<pre><code>&lt;!--[if gt IE 6]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if gte IE 7]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<h4>Target IE 8 and HIGHER<\/h4>\n<pre><code>&lt;!--[if gt IE 7]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie8-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;<\/code><\/pre>\n<pre><code>&lt;!--[if gte IE 8]&gt;\r\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie8-and-up.css\" \/&gt;\r\n&lt;![endif]--&gt;\r\n<\/code><\/pre>\n<p><strong>P.S. I am a Mozilla Firefox fan!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The key to create IE specific styling is called conditional stylesheet.\u00a0 IE provides comment tags, supported all the way up to the current IE 8 to target specific versions, as well as greater-than\/less-than stuff for targeting multiple versions at once. Why use conditional stylesheets? You got problems, they need fixin&#8217; Keeps your code hack-free and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.pawebgate.com\/blogging\/ie-specific-styling\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;IE Specific Styling&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[19,12,83],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-web-design","tag-css","tag-conditional-styling","tag-web-design","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":14,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/posts\/54\/revisions\/150"}],"wp:attachment":[{"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pawebgate.com\/blogging\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}