asp.net - Visual Studio 2010 源格式 HTML div 标签

标签 asp.net html visual-studio-2010 code-formatting

我已将我的 div 标签设置为在“打开之前、之内和关闭之后”插入换行符,但我在内容之后没有换行符。

我明白了:

<div>
   content</div>

但我想要这个:

<div>
   content
</div>

同样,我在选项中做出了正确的选择。它甚至在预览框中显示正确的方式。如果我将选择更改为无换行符,则格式正确。

这是其他人的问题吗?

请注意,这是在 aspx/c 页面中。

最佳答案

它不分隔结束的 div 元素的原因是因为在那里添加一个空格可能会改变渲染的空白语义。
看看scott gutherie 发表的最后评论:http://weblogs.asp.net/scottgu/archive/2006/07/07/Tip_2F00_Trick_3A00_-Custom-formatting-HTML-in-Visual-Web-Developer-and-Visual-Studio-2005.aspx

关于asp.net - Visual Studio 2010 源格式 HTML div 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11005738/

相关文章:

asp.net - 根据验证程序,远程证书无效。通用邮箱

asp.net - 使用 ContentPlaceHolder 的默认内容而不是页面内容

html - 在网页上定位 3 个 Bootstrap Jumbotrons

visual-studio - Visual Studio - 如何显示 svn 注释?

c++ - 将 C++ 项目从 Visual Studio 2008 转换为 Visual Studio 2010

visual-studio-2010 - 如何在 Windows Phone 7 开发的 Visual Studio Express 窗口左侧显示工具箱?

asp.net - 在 asp net core (asp net 5) 中设置身份验证

html - 文本溢出 : ellepsis not working

html - CSS:如何让这个叠加层通过滚动扩展 100%?

asp.net - 实体类型 'Customer' 无法映射到表,因为它是从 'ApplicationUser' 派生的