简体   繁体   中英

stop visual studio from formatting code

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?

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">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM