Take the 2-minute tour ×

I've got my div tags set to insert line breaks "Before opening, within, and after closing" but I'm not getting the line break after the content.

I'm getting this:


But I want this:


Again, I have the correct selection made in the options. It even shows the correct way in the preview box. If I change the selection to no line breaks, it formats correctly.

Is this an issue for anyone else?

Note, this is in aspx/c pages.

share|improve this question
This seems to be a bug with VS and also occurs for <Hx> tags... –  IrishChieftain Jun 12 '12 at 22:25
add comment

1 Answer

up vote 1 down vote accepted

The reason it doesn't separate the closing div element is because adding a space there would potentially change the whitespace semantics of the rendering.
Have a look at the last comment made by scott gutherie : http://weblogs.asp.net/scottgu/archive/2006/07/07/Tip_2F00_Trick_3A00_-Custom-formatting-HTML-in-Visual-Web-Developer-and-Visual-Studio-2005.aspx

share|improve this answer
That makes no sense, can you explain what you take from that? –  IrishChieftain Jun 12 '12 at 23:20
Basically the visual studio formatter sees that there isn't a space between the content and the closing div. By moving the closing div on the new line you have added whitespace to content which probably wasn't intended. If you manually add white space to the content it should format correctly –  AvengingBudda Jun 12 '12 at 23:36
gotcha...... :) –  IrishChieftain Jun 12 '12 at 23:37
add comment

Your Answer


