结束标记缺少匹配的开始标记 [英] End tag is missing matching start tag

查看:2244
本文介绍了结束标记缺少匹配的开始标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以下code /标记我的 Index.cshtml

I have the following code/markup in my Index.cshtml:

<p>
    @Html.ActionLink("Create New", "Create")

    @using (Html.BeginForm("Index", "Clients", FormMethod.Get))
    {
    <p>
        Title: @Html.TextBox("search") <br />
        <input type="submit" value="Search" />
    </p>
    }
</p>

的Visual Studio 2013警告我说的最后一行(&LT; / P&GT; )不具有一个开始标记。我没有任何其他的&LT; P&GT; &LT; / P&gt;在文件中标记。这是怎么回事?

Visual Studio 2013 warns me that the last line (</p>) doesn't have a start tag. I don't have any other <p> or </p> tags in the document. What's going on?

已满警告消息:结束标记缺少匹配的开始标记

推荐答案

有关段落两个重要的事实:

Two important facts about paragraphs:


  • P 元素的结束标记是可选的。

  • P 元素不能包含其他 P 元素。

  • The end tag for p elements is optional.
  • p elements cannot contain other p elements.

这意味着:


  1. 第一个 P 开始标签打开的第一个 P 元素。

  2. 第二个 P 开始标签关闭第一个 P 元素,然后打开第二个元素。

  3. 第一个 P 结束标记关闭第二 P 元素。

  4. 第二个 P 结束标记没有打开的 P 元素关闭。

  1. The first p start tag opens the first p element.
  2. The second p start tag closes the first p element then opens the second p element.
  3. The first p end tag closes the second p element.
  4. The second p end tag has no open p element to close.

这篇关于结束标记缺少匹配的开始标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆