html - aligning controls in asp.net and css -


i have webform app have desinged seen in image. vs designer

now here browser render same page. broser output

as can see output misaligned. designer file perfect.

the markup long post here have 2 div 1 left , right alinged perfectly.

i use following css tags

  .label, .textbox{   width:150px;   text-align:left;   float:left;   display:block;   }  .label, .dropdownlist{  width:150px;  text-align:left;  float:left;  display:block;  }  .label,.dropdownlist{   text-align:left;  float:left;  display:block;  margin-left: 23px;   } 

there no other relevant can think of can make such misalgined output. 1 more thing every control nested withing ul tag.

any , appreaciated.

i think might helpful clean css, little redundant. following equivalent current css rules:

.label, .textbox, .dropdownlist {     width:150px;     text-align:left;     float:left;     display:block; }  .label,.dropdownlist {      margin-left: 23px; } 

this looks okay you're trying accomplish (i think display:inline-block might more semantic choice, since you're floating left, don't think makes difference).

however, statement:

one more thing every control nested withing ul tag

concerns me little bit. looks whatever wrapped around controls not being displayed in 150px wide block-style format, causing space between elements dependent on number of characters in label.

you use browser's developer tools see css rule setting width of label controls (or whatever wrapped around label controls) that's less 150 pixels.

it helpful if showed html - or better yet, small example on jsfiddle.net demonstrates problem.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -