< br>代替< br/>在Visual Studio中 [英] <br> instead of <br/> in Visual Studio

查看:136
本文介绍了< br>代替< br/>在Visual Studio中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio教授HTML.我们使用HTML 4.01 Transitional. Visual Studio默认为XHTML 1.0,我需要解决一个问题,这两个HTML标准之间存在典型的区别:每当我们输入<br><hr>时,它都会自动地分别更改为<br /><hr />.这对XHTML非常有用,但是在HTML 4.01模式下工作时则不需要.

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.

所以如何关闭此自动魔术功能?我们主要使用Visual Studio 2010,有时也使用2012和2008.

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

(我知道如何轻松地将验证切换到HTMl 4.01模式,但是它仍然对每个<br><hr>等都加上斜杠)

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

推荐答案

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

您可以为每个单独的标签定义行为.按下 CTRL + K + D 重新格式化文档,您应该会看到更改.

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

这篇关于&lt; br&gt;代替&lt; br/&gt;在Visual Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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