:: before does not work as it should

1

I bought a CSS and I'm trying to apply it to my site, the cass I bought has a validation scheme in the form where it circulates the form with a red line and places an X inside the text box. I will put an image here to be easy to understand, this is the template I bought.

Now,minelookslikethis:

ThedifferenceofHTMListheinclusionofa::beforeandaclass(whichIthinkiswhatputsthebefore,butI'mnotsurehowthisworks,I'mlearning)

Theformcomponentisinone,followstheexampleofthefirstcomponentalreadywithactiveerrorvalidation:

<div class="form-group  has-error">
::before
<label class="sr-only" for="Nome">Nome</label>
                
<input class="input-validation-error form-control input-lg required text-box single-line" data-val="true" data-val-required="O campo Nome é obrigatório." id="name" name="Nome" placeholder="Name" type="text" value=""> <ul class="parsley-errors-list" id="parsley-id-1125"></ul>
                
                
</div>

The :: before is the "X" I want to put, it has the following css:

.contact-form .has-error:before {
    content: "\f00d";
    color: #d2322d;
}

Because in my project it has a square and the purchased project is an X?

    
asked by anonymous 22.10.2015 / 15:24

1 answer

3

The Awesome Font is installed incorrectly. As is ASP.NET MVC, use the appropriate NuGet package to use it .

Also check that in your App_Start/BundleConfig.cs file there is a CSS entry for CSS for Awesome Font. I use this way:

bundles.Add(new StyleBundle("~/BundledContent/css").Include(
                  "~/Content/bootstrap.css",
                  /* Aqui tem mais uma cacetada de coisas, mas vou pular pro que interessa */
                  "~/Content/font-awesome.css"));

Also check your web.config to allow some extensions in static mode. The ASP.NET MVC route often misinterprets these references:

<configuration>
...
  <system.webServer>
  ...
    <staticContent>
      <remove fileExtension=".svg" />
      <remove fileExtension=".eot" />
      <remove fileExtension=".woff" />
      <remove fileExtension=".woff2" />
      <remove fileExtension=".otf" />
      <remove fileExtension=".json" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
      <mimeMap fileExtension=".woff2" mimeType="application/x-woff2" />
      <mimeMap fileExtension=".json" mimeType="text/json" />
    </staticContent>
  ...
  </system.webServer>
...
</configuration>
    
22.10.2015 / 15:46