Home > Article > Web Front-end > How can I center the INPUT vertically in the following code_html/css_WEB-ITnose
2c1c01fe3da5b45638b932defb4b63fc
acf251eef30dadcd95fda0b63932cc24
93f0f5c25f18dab9d176bd4f6de5d30e
efd2567c1fb77e16e60d87a2c199ee8e
b2386ffb911b14667cb8f0f91ea547a7表格6e916e0f7d1e588d4f442bf645aedb2f
ef0d2420b1e5291570a81009eee48a1a
ul {width:100%;height:100%;list-style:none}
li {float:left; height:60px;text-align:center;line-height:60px; padding-top:5px;}
li.b {border-bottom:1px solid #000;width:18%;border-right:1px solid #000; }
li.zhongjian {border-bottom:1px solid #000; width:58%;border-right:1px solid #000; }
li.you {
border-bottom:1px solid #000;
width:18%; margin-top:auto;
}
531ac245ce3e4fe3d50054a55f265927
9c3bca370b5104690d9ef395f2c5f8d1
6c04bd5ca3fcae76e30b72ad730ca86d
b6062d995580ceb60a93c9528e2fe7ac
ff6d136ddc5fdfeffaf53ff6ee95f185
a51123fc55f13110589b11f8aa656c06生活更美好1bed06894275b65c1ab86501b08a632eb
86fc9455b0257fcb2d739246851ef5cfc9b1bd14e1c368c191df63e3f47c577abed06894275b65c1ab86501b08a632eb
df5766507cfc048aacbe9ef9f9029e831305d3f860b2f09c777332cc6b1bfd6dbed06894275b65c1ab86501b08a632eb
929d1f5ca49e04fdcb27f9465b944689
16b28748ea4df4d9c2150843fecfba68
a59fa70451b664044f5e78c546ecb6fc16b28748ea4df4d9c2150843fecfba68
ff7cbb79a72b4e9cd999c2f74ece7d5e
ff6d136ddc5fdfeffaf53ff6ee95f185
a51123fc55f13110589b11f8aa656c06生活更美好2bed06894275b65c1ab86501b08a632eb
86fc9455b0257fcb2d739246851ef5cf9ec72df81db25cd38b0d3d6f8662201c3e6355b69ff53a5cab7780ef8a435ea2bed06894275b65c1ab86501b08a632eb
df5766507cfc048aacbe9ef9f9029e8345a2772a6b6107b401db3c9b82c049c254bdf357c58b8a65c66d7c19c8e4d114bed06894275b65c1ab86501b08a632eb
929d1f5ca49e04fdcb27f9465b944689
16b28748ea4df4d9c2150843fecfba68
a59fa70451b664044f5e78c546ecb6fc16b28748ea4df4d9c2150843fecfba68
8ac8afe7b8515c30e7392bb6a1c302a7
ff6d136ddc5fdfeffaf53ff6ee95f185
a51123fc55f13110589b11f8aa656c06生活更美好3bed06894275b65c1ab86501b08a632eb
86fc9455b0257fcb2d739246851ef5cf9ec72df81db25cd38b0d3d6f8662201c3e6355b69ff53a5cab7780ef8a435ea2bed06894275b65c1ab86501b08a632eb
df5766507cfc048aacbe9ef9f9029e831305d3f860b2f09c777332cc6b1bfd6dbed06894275b65c1ab86501b08a632eb
929d1f5ca49e04fdcb27f9465b944689
16b28748ea4df4d9c2150843fecfba68
a59fa70451b664044f5e78c546ecb6fc16b28748ea4df4d9c2150843fecfba68
9bc988c8d379612a3b235e5490d962db
window.onload=function(){
var a=document.getElementsByTagName("div");
for(i=0;i8fa1c541ab196d474a4bab61aecf96ba
36cc49f0c466276486e50c850b7e4956
73a6ac4ed44ffec12cee46588e518a5e
你的input就放在li中,而且li中只有一个input元素,那么你调input在li中的位置就行了
如果input旁边有文字就用 vertical-align:middle;
添加这一个css input 在IE下line-height设置是失效的 chrome等没有问题 现在偶的解决方案就是用margin
/* for IE */li input{ margin:20px;}