<!--[if IE 7]> <script type="text/javascript"> document.body.className='ie7'; </script> <![endif]--> <!--[if IE 8]> <script type="text/javascript"> document.body.className='ie8'; </script> <![endif]--> <body> <div class="example"> <p> <strong></strong> , </p> </div> </body> .example p{ color: green; } .ie8 .example p{/* IE 8*/ color: yellow; margin-top: 8px; } .ie7 .example p{/* IE 7*/ color: red; margin-top: 5px; } .ie7 .example p strong, .ie8 .example p strong{/* IE 7 IE8*/ color: #000; } <body> <!--[if IE 7]> <div class="ie7"> <![endif]--> <!--[if IE 8]> <div class="ie8"> <![endif]--> <!--[if lt IE 9]> <div class="lte9"> <![endif]--> <div class="example"> <p> <strong></strong> , </p> </div> <!--[if lt IE 9]> </div> </div> <![endif]--> </body> <body> <!--[if IE 7]> <div class="ie7"> <![endif]--> <!--[if IE 8]> <div class="ie8"> <![endif]--> <div class="example"> <p> <strong></strong> , </p> </div> <!--[if lt IE 9]> </div> <![endif]--> </body> .example p{ color: green; } .ie8 .example p{/* 8*/ color: yellow; margin-top: 8px; } .ie7 .example p{/* 7*/ color: red; margin-top: 5px; } .ie7 .example p strong, .ie8 .example p strong{ color: #000; } Source: https://habr.com/ru/post/138118/
All Articles