Should whitespace in the markup in a cshtml file be meaningful?

hansonhorse

New Member
I'm seeing some strange behavior while trying to add a basic markup for a login form in an ASP.Net MVC 4 project. Here's the portion of my cshtml file in question:\[code\]<form class="navbar-form pull-right"> <input type="text" placeholder="Email" class="span2" /> <input type="password" placeholder="Password" class="span2" /> <button class="btn" type="submit">Sign in</button></form>\[/code\]That markup renders great in my theme:
zXGiu.png
However, if I change it to this:\[code\]<form class="navbar-form pull-right"> <input type="text" placeholder="Email" class="span2" /><input type="password" placeholder="Password" class="span2" /> <button class="btn" type="submit">Sign in</button></form>\[/code\]It starts rendering like this:
jdYqL.png
I noticed this because I was trying to take a simple form from a foundational theme and implement it with \[code\]Html.BeginForm()\[/code\]. This results in markup that's all on one line though, so I'm seeing that squeezed look.I can probably just correct it with some css, but I'm curious if anyone knows why I'm seeing this behavior. Any ideas?
 
Back
Top