问题
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