I do not recognize the css for IE

1

I am trying to create some CSS for IE since there are several things that are out of line with me and when I create the CSS, I do not recognize the CSS and it does not do anything to me

HTML

<link href="/Content/site.css" rel="stylesheet">
<!--[if gte IE 8]>
        <link href="/Content/IE/ie.css" rel="stylesheet"/>

    <![endif]-->

div where the class is

<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 col-lg-offset-4 col-md-offset-4 section-login" id="col-right">
            <section id="loginForm" class="col-lg-6 col-md-6 col-sm-8 col-xs-12">
                <div>
                    @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
    {
                @Html.AntiForgeryToken()

                <div class="form-group">
                    @*<h2>@ViewBag.Title.</h2>*@

                    <p class="text-center"><img src="~/Content/images/logo-evoluciona.png" /></p>
                    <div class="col-md-12">
                        <div class="sbForm">
                            @Html.LabelFor(m => m.Email, new { @class = "control-label" })
                            @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
                            @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
                        </div>
                    </div>
                </div>
...

CSS

.section-login {
    margin-top: 200px;
}

When I give it to inspect element, it appears well in the head the call to the css of IE but then it does not do anything to me, I go to the line of the code where I put the class and it does not recognize me and it does not lower me the div the 200px that I put in the CSS and I do not know what I'm doing wrong so that I do not recognize it.

Can you help me please

Thank you very much

    
asked by derek 12.03.2018 в 09:49
source

1 answer

2

Conditional comments do not work from IE 10

  

Support for Conditional Comments in Internet Explorer 10 in standards and quirks modes to improve interoperability and conformance with HTML5 has been removed. This means that Conditional Comments are now treated as regular comments, as in any other browser.

     

Source: Conditional comments are no longer supported (Microsoft Docs) .

So that conditional comment will only work for IE 8 or 9. This is a thing of the past.


To detect the browser, you can check with feature detection ( browser hacks or CSS hacks ), such as:


For example, for IE 10 and 11 , the following rule of @ :

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* Acá tus reglas que sólo aplican a IE 10 e IE 11 */
    .clase-ejemplo { color:green; }
}


Another option would be to emulate IE 9 with

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

in the <head> of the page, but I really do not recommend it.

    
answered by 12.03.2018 / 11:29
source