By default, a new ASPX page contains the following:
默认情况下,新的ASPX页面包含以下内容:
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
I'm curious--is there any reason I should leave that div tag in?
我很好奇 - 有什么理由我应该留下那个div标签吗?
5 个解决方案
#1
There's no real point, but I don't think it's standards-compliant to write text straight after a <form>
tag, but it would be inside a <div>
. Feel free to delete it though.
没有真正的意义,但我不认为在
#2
To put things in it? It's not necessary, but it prevents you from having to create a div tag when starting out your web layout.
把东西放进去吗?这没有必要,但它可以防止您在开始Web布局时创建div标签。
#3
Why? Because said DIV is part of the template. No, it doesn't matter and you can feel free to get rid of it.
为什么?因为所说的DIV是模板的一部分。不,这没关系,你可以随意摆脱它。
#4
Maybe they are subtly encouraging designers to shed the <TABLE>
mentality and move to <DIV>s
. ;-)
也许他们巧妙地鼓励设计师摆脱
#5
If you don't like it, you can always edit the default template to remove them permanently:
如果您不喜欢它,您可以随时编辑默认模板以永久删除它们:
C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\CSharp\WebForm.aspx
C:\ Program Files \ Microsoft Visual Studio 9.0 \ Web \ WebNewFileItems \ CSharp \ WebForm.aspx
C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\VB\WebForm.aspx
C:\ Program Files \ Microsoft Visual Studio 9.0 \ Web \ WebNewFileItems \ VB \ WebForm.aspx
Just remove the <div> </div> tags from the relevant one of these for your projects.
只需从项目中相关的一个中删除
#1
There's no real point, but I don't think it's standards-compliant to write text straight after a <form>
tag, but it would be inside a <div>
. Feel free to delete it though.
没有真正的意义,但我不认为在
#2
To put things in it? It's not necessary, but it prevents you from having to create a div tag when starting out your web layout.
把东西放进去吗?这没有必要,但它可以防止您在开始Web布局时创建div标签。
#3
Why? Because said DIV is part of the template. No, it doesn't matter and you can feel free to get rid of it.
为什么?因为所说的DIV是模板的一部分。不,这没关系,你可以随意摆脱它。
#4
Maybe they are subtly encouraging designers to shed the <TABLE>
mentality and move to <DIV>s
. ;-)
也许他们巧妙地鼓励设计师摆脱
#5
If you don't like it, you can always edit the default template to remove them permanently:
如果您不喜欢它,您可以随时编辑默认模板以永久删除它们:
C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\CSharp\WebForm.aspx
C:\ Program Files \ Microsoft Visual Studio 9.0 \ Web \ WebNewFileItems \ CSharp \ WebForm.aspx
C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\VB\WebForm.aspx
C:\ Program Files \ Microsoft Visual Studio 9.0 \ Web \ WebNewFileItems \ VB \ WebForm.aspx
Just remove the <div> </div> tags from the relevant one of these for your projects.
只需从项目中相关的一个中删除