IE7 Only MVC Style Sheet

I only need the IE7 stylesheet in my ASP.net MVC project.

What is the best approach to this:

<!--[if IE 7]><link href="@Url.Content("~/Content/IE7.css")" rel="stylesheet" type="text/css" /><![endif]--> 

OR

 @if(Request.Browser.Browser == "IE" && Request.Browser.MajorVersion >= 7 && Request.Browser.MajorVersion < 8) { <link href="@Url.Content("~/Content/IE7.css")" rel="stylesheet" type="text/css" /> } 

Is there a preferred way to do this in MVC, or are they pretty much equal?

+4
source share
1 answer

Your two options do completely different things. First, [if IE 7] allows the browser to decide what to do. The second makes the server crucial.

The first will work with layer caching, which assumes that all browsers should see the same markup. The second will not.

Also, consider Modernizr rather than building your own support for IE 7.

+2
source

Source: https://habr.com/ru/post/1379150/


All Articles