HTML5 rendering with Razor

Asked

Viewed 176 times

1

According to W3schools an input has no tag closure ex

<input type="text" name="firstname" value="Mickey">

source: http://www.w3schools.com/html/html_forms.asp

In my ASP.NET MVC project I have the following command

@Html.TextBoxFor(model => model.Erro, new { @class = "form-control" })

The result of the rendering is

<input class="form-control" id="Erro" name="Erro" type="text" value="" />

The result should not be the below?

<input class="form-control" id="Erro" name="Erro" type="text" value="">

Have some configuration to be done on ASP.NET, upgrade, anything to render according to HTML5?

  • Eye, from what I’ve read so far from HTML5 some tags no longer have closure /> mandatory , but still can be used the lock normally, even by the fact of giving support to previous versions .

1 answer

5

According to W3schools itself:

In HTML, the <input> has tag in end tag.

In XHTML, the <input> tag must be properly closed, like this <input />.

HTML5 follows the XHTML standard more than HTML (4). That is, it is correct.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.