stop visual studio from formatting code

江枫思渺然 提交于 2020-01-17 13:43:30

问题


How do you stop visual studio 2013 from formatting code

visual studio is inserting spaces after colons in my inline styles in a html file, which breaks it.

<div style=float:left;width:150>

It puts spaces after the colons

I know I could put the style in quotes, or use a stylesheet, but I don't want to.

Is it possible to stop VS from messing with your code?


回答1:


Go to Tools > Options > Text Editor > HTML (Web Forms) > Formatting and configure the formatting options you want.

Also, keep in mind that your "code" isn't actually valid html, attribute values should be wrapped in quotes. That's why it's messing with your spaces.

<div style="float:left;width:150">


来源:https://stackoverflow.com/questions/29276175/stop-visual-studio-from-formatting-code

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