Home > Web Front-end > HTML Tutorial > How can I center the INPUT vertically in the following code_html/css_WEB-ITnose

How can I center the INPUT vertically in the following code_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:34
Original
1431 people have browsed it

 
 
 
 
表格 
 
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;


 

 
 

  
      
    生活更美好1  
      
      
  


  
      
    生活更美好2  
      
      
  
  

  
  





window.onload=function(){
var a=document.getElementsByTagName("div");
for(i=0;i {
var b=a[i].getElementsByTagName("textarea");
if(b.length==0)
{
a[i].style.display='none';
}
}
}

 


回复讨论(解决方案)

你的input就放在li中,而且li中只有一个input元素,那么你调input在li中的位置就行了
如果input旁边有文字就用 vertical-align:middle;

添加这一个css    input 在IE下line-height设置是失效的   chrome等没有问题  现在偶的解决方案就是用margin

/* for IE */li input{	margin:20px;}  
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template