<br> instead of <br/> in Visual Studio

六眼飞鱼酱① 提交于 2019-12-07 04:50:03

问题


I use Visual Studio for teaching HTML. We use HTML 4.01 Transitional. Visual Studio defaults to XHTML 1.0, and I need to solve one problem with a typical difference among these two HTML standards: Whenever we enter <br> or <hr>, it is automagically changed to <br /> or <hr /> respectively. This is great for XHTML, but unwanted when working in HTML 4.01 mode.

So how to turn off this automagical feature? We use mainly Visual Studio 2010, and sometimes also 2012 and 2008.

(I know how to easily switch validation to HTMl 4.01 mode, but it still puts slashes to each <br>, <hr> etc.)


回答1:


Tools -> Options -> Text Editor -> HTML -> Formatting -> Tag Specific Options

You may define behavior for each individual tag. Hit CTRL + K + D to reformat the document and you should see the change.

Specific Tags

Alternative Method (All Tags)




回答2:


Old question, but even more relevant today.

In Visual Studio 2015, Tools, Options:




回答3:


Tool -> Options -> Text Editor -> HTML -> Format -> Tag Specific Options... -> Client HTML Tags -> br


来源:https://stackoverflow.com/questions/13031694/br-instead-of-br-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!