结束标记缺少匹配的开始标记 [英] End tag is missing matching start tag
本文介绍了结束标记缺少匹配的开始标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在以下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 otherp
elements.
这意味着:
- 第一个
P
开始标签打开的第一个P
元素。 - 第二个
P
开始标签关闭第一个P
元素,然后打开第二个点
元素。 - 第一个
P
结束标记关闭第二P
元素。 - 第二个
P
结束标记没有打开的P
元素关闭。
- The first
p
start tag opens the firstp
element. - The second
p
start tag closes the firstp
element then opens the secondp
element. - The first
p
end tag closes the secondp
element. - The second
p
end tag has no openp
element to close.
这篇关于结束标记缺少匹配的开始标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文