gpt4 book ai didi

css - DIV/表格对齐

转载 作者:行者123 更新时间:2023-11-28 14:33:07 24 4
gpt4 key购买 nike

首先让我声明我不是网络开发人员。我更多地从事嵌入式方面的工作。我完全不了解网页设计标准或常见做法。非常感谢任何帮助。

我想要完成的事情

制作一个带有多行复选框/下拉菜单/文本框的表单,操作起来非常简单直观。它必须与 IE 6+ 完全兼容。任何其他浏览器都不是强制性的(这是一个只能在 IE 上查看的内部解决方案)。

我一直试图完成的事情是创建另一列与当前集合对齐的复选框。

这是它目前在 IE 中的样子

我的代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<style type="text/css">
.right_div_check_boxes { width:70%;float:right;} <!-- 75% -->
.left_div_input_boxes {width:15%;float:left;} <!--15%-->

</style>




<div class="left_div_input_boxes" style="position:relative">

<form>
<label>Submitted by (First Name)</label>
<input type="text" style="width:150px" name="firstname" /><br>
<label>Submitted by (Last Name)</label><br>
<input type="text" name="lastname"/>
<label>Employee Number</label><br>
<input type="text" name="employnum"/>


<form>
<label>What</label>
<select style="width:150px" name="observer">
<option value="other">TEST</option>
<option value="other">TEST</option>
<option value="other">TEST</option>
</select>


<label>Who</label>
<form action="">
<select style="width:150px" name="who">
<option value="other">TEST</option>
<option value="other">TEST</option>
<option value="other">TEST</option>
</select>




<label>Operation Code</label>
<select style="width:150px" name="opcode">
<option value="other">TEST</option>
<option value="other">TEST</option>
</select>



<label>Center</label>
<select style="width:150px" name="cost">

<option value="Zone 1"> Zone 1 </option>
<option value="Zone 2"> Zone 2 </option>
<option value="Zone 3"> Zone 3 </option>
</select>
</form>

</div>


<div class="right_div_check_boxes" style="position:relative">
<label>Dangers</label>
<form>

<input type="checkbox" name="vehicle" value="Bike" />Line of Fire<br />
<input type="checkbox" name="vehicle" value="Car" />Respirtory Protection<br />
<input type="checkbox" name="vehicle" value="Car" />Ears/Hearing Protection<br />
<input type="checkbox" name="vehicle" value="Car" />Eye/Face Protection<br />
</div>
<br />



</head>
<body>

</body>
</html>

最佳答案

使用表格而不是 div。如果您需要添加更多行,那至少与在此上下文中添加更多行一样简单。添加另一列复选框也同样简单。只需向表中添加另一列即可。

关于css - DIV/表格对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7109265/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com