开发者

Visual Studio 2008: Keeping vertical space between tags when code formatting HTML

Quite new to Visual Studio, more of a PHP/Eclipse person.

I prefer to have lots of white space in my markup - it makes it easier to edit, I find.

However, when I format the markup with CTRL K CTRL D, VS2008 strips out all vertical whitespace (ie, newlines) between my tags.

Is there a setting to prevent this and only indent my markup?

I have not been ab开发者_C百科le to find anything online that seems to address this, neither is there a previous question that I could find.

Thanks in advance,

G


Found the answer: the settings for empty lines before and after HTML tags are, infuriatingly, tag-specific. So I've had to set it in several places.

You don't quite have to do it for each particular tag, though, there are four kinds you have to set it for.

For your information, Tools -> Options -> Text Editor -> HTML -> Format -> Tag Specific Options -> Default Settings and then the four types are listed under there. Select your value from the 'Line breaks' dropdown and click OK when done. The CTRL K, CTRL D will add lots of vertical whitespace as desired.

Thanks if you've been looking at this, and I hope this helps others.

G

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜