表单元格计算不正确

用户名

我正在努力保持自己form fieldsets的状态table-cells我按百分比应用宽度。field sets孩子的标签为“ not calculating the width as33.33%”。

这是什么问题?

*{
  padding:0;
  margin:0;
}

form{
/*   display:table;
width:100%; */
  border:1px solid gray;
}

legend {
  color:red;
  border-bottom:2px solid gray;
  width:100%;
}

filedlset {
  width:100%; /*width added*/
  background:brown;
  
}

filedlset label {
  display:table-cell;
  width:33.33%;/*not working*/
  border-right:1px solid blue;
}

filedlset label input {
  margin-bottom:0.5em;
  border:0;
  background:gray;
}

filedlset span {
  display:block;
  margin-bottom:0.5em;
}
 <form action="">
      
      <filedlset>
        <legend>Form1</legend>
        <label for=""><span>Name: </span> <input type="text"> <span>Error</span></label>
        <label for=""><span>Middle: </span> <input type="text"> <span>Error</span></label>
        <label for=""><span>Last: </span> <input type="text"> <span>Error</span></label>
      </filedlset>
     
      
    </form>

这____

删除display: table-cell元素并flex在容器上使用(加上添加box-sizing: border-box;具有填充和/或边框的元素):

body {
  width: 100%;
  height: 100%;
  margin: 0px;
  background: skyblue;
}

form {
  width:100%;
  border:1px solid gray;
  box-sizing: border-box;
}

legend {
  color:red;
  background: khaki;
  border-bottom: 2px solid gray;
  width:100%;
  box-sizing: border-box;
}

filedlset {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  width:100%; /*width added*/   
}

filedlset label {
  width:33.33%;  
  border-right:1px solid blue;
  background: lavender;
  box-sizing: border-box;
}

filedlset label input {
  margin-bottom:0.5em;  
  border:0;
  background:gray;
}

filedlset span {
  display:block;
  margin-bottom:0.5em;
}

.a {
margin-top: 5px;
margin-left: 5px;
display: inline;
}

input[type=text] {
width: 68%;
margin-top: 5px;
margin-right: 5px;
}
<form action="">
<filedlset>
<legend>Form1</legend>

<label for=""><span class=a>Name: </span> <input type="text"> <span style="background:tomato">Error</span></label><label for=""><span class=a>Middle: </span> <input type="text"> <span style="background:tomato">Error</span></label><label for=""><span class=a>Last: </span> <input type="text"> <span style="background:tomato">Error</span></label>

</filedlset>
</form>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

R中的write.xlsx在单元格中给出不正确的NA

包含可滚动的pre时表格单元格大小不正确

计算不正确

抛出异常-报废:哪个单元格包含不正确的值

为什么存在图像时我的表格单元格大小不正确?

PDF Rmarkdown-多行单元格中的不正确对齐

集合视图中单元格的宽度不正确

将单元格显示为Excel中的不正确分数?

UITableView单元格删除不正确

自定义单元格在TableView中显示不正确

iOS 8以不正确的高度显示表格视图单元格的内容

表格视图单元格中的图像分配不正确

Excel Precedents.Count在单元格公式内返回不正确的值

VBA querytables循环将检索到的数据放置在不正确的单元格中

滚动时单元格显示不正确

Office Interop读取不正确的单元格值

图片在集合视图单元格中不正确

TableView显示单元格不正确

Xamarin CollectionView滚动时突出显示不正确的单元格

使用OLEDB读取Excel,某些单元格读取不正确

自行调整大小的 UITableView 单元格大小不正确

UICollectionView 单元格显示不正确

写入谷歌表格中的单元格时出现不正确的范围错误

单元格值不正确

UITableView 单元格显示不正确

ag-grid CellEditor 单元格高度不正确

Excel 中的 INDEX MATCH 公式在某些单元格中返回不正确的结果,而在其他单元格中返回正确的结果

SUMIF SUM IF 公式计算不正确 - 计算空白单元格

TVirtualStringTree 显示不正确的数据,即在每个单元格中显示“节点”。如何显示正确的数据?