FIRST you should make sure none of you other CSS code is overriding your stile for these elements.
The vertical-align: middle; directive does not work.
Only tables (or elements with display:table) can vertically align content. Consequently, you need to set the LI's to display:table-cell; vertical-align:middle; but this will have it's own problems not the least of which is IE support. BTW.. if this a TABULAR, then you should use a TABLE tag anyway.
What has previously been suggested should work, but you need to coordinate the calculated height of the content of the LIs. In another words, the text in (1) might be bigger or smaller than the height of the inputs. so forexample ( and BTW this is just for example, AVOID USING PX for text size)
the text in (1) is 15px (+5px in lineheight) +20px of vertical padding= 40px but the checbox is only 10px +20px of padding=30px . See?
I think the best solution would be to use a pseudo element as a centering tool.
Code:
<style type="text/css">
ul, li {margin:0; padding:0;} /* general reset */
li{float:left; border:1px solid red; padding:0 10px}
li+li{border-left:none; width: auto}
ul,li{height:50px;}
li:after{display:inline-block; content:""; height:50px; vertical-align:middle}
.textG{display:inline-block; vertical-align: middle} /* wraping the text in a span is optional, but its a good idea if you also plan to limit the with of the parent LI */
/* more optional stuff to make it display like a grid*/
.row {clear:left; border-left:1px solid red; border-top:none}
li, .row{ width:100px}
.row ~li {border-top:none}
</style>
<ul>
<li><span class='textG'>Riverdale High School</span></li>
<li><input type="checkbox" name="Part" value="Yes"></li>
<li><input type="text" name="Time"/></li>
<li class="row"><span class='textG'>San Pasqule High School</span></li>
<li><input type="checkbox" name="Part" value="Yes"></li>
<li><input type="text" name="Time"/></li>
<li class="row"><span class='textG'>East High School</span></li>
<li><input type="checkbox" name="Part" value="Yes"></li>
<li><input type="text" name="Time"/></li>
</ul>
HOWEVER!!!
I think this is a far more SEMANTIC solution:
Code:
<style type="text/css">
ul, li {margin:0; padding:0;list-style: none;} /* general reset */
ul{border-bottom:1px solid red; float:left;}
li {overflow:hidden; border:1px solid red; border-right:none;border-bottom:none;}
.seg{float:left; border-right:1px solid red; height:50px; padding: 0 10px}
.seg:after{content:"";height:100% }
.seg span, .seg:after{display:inline-block;vertical-align:middle}
.seg { width:6.5em}
.seg+.seg{width: auto}
</style>
<ul>
<li><span class='seg'><span>Riverdale High School</span></span>
<span class='seg'><input type="checkbox" name="Part" value="Yes"></span>
<span class='seg'><input type="text" name="Time"/></span></li>
<li><span class='seg'><span>East High School</span></span>
<span class='seg'><input type="checkbox" name="Part" value="Yes"></span>
<span class='seg'><input type="text" name="Time"/></span></li>
<li><span class='seg'><span>San Pasquale High School</span></span>
<span class='seg'><input type="checkbox" name="Part" value="Yes"></span>
<span class='seg'><input type="text" name="Time"/></span></li>
</ul>
I would also suggest using a height in EMs or EXs instead of PX, for added fluidity.
Bookmarks