HTML 中怎样使input占据表格的整个td

2025-04-28 20:32:36
推荐回答(4个)
回答1:

加一段这个就好了,亲测有效


    input{
     border: none;
     overflow: hidden;
     height: 100%;
     width: 100%;
  } 

试过好用的请回来点赞,谢谢!!!(在部分浏览器不兼容。。。)

回答2:

首先看看你的table宽度是多少,才250px,input你没有设置宽度
td input{background-color:#CCFFFF;margin-top:-1px;margin-bottom:-1px;height:80px; width:100%;border:none;}这样你试试。

回答3:

把他的width和height设为100%

回答4:

你截图看看!