Evgeny Pokhilko's Weblog

Programmer's den

Align label and input vertically

On an html form we usually have the following layout:




By default a label can be a bit higher than the text box. The solution is to apply this CSS to both the elements:

.inputOrLabel {




Vertical alignment of blocks is difficult in other cases. See this article for more details.

June 12, 2013 Posted by | ASP.NET, CSS | Leave a comment