gpt4 book ai didi

html - 我们如何使用 css 和 html 制作这样的表格?

转载 作者:太空宇宙 更新时间:2023-11-03 20:59:37 25 4
gpt4 key购买 nike

enter image description here

现在这是个问题:|

感谢关注

亚当·拉马丹

最佳答案

嗯,我用它来学习表单和 CSS :)感谢@corroded 的评论(找不到更多的 DIV!)在 FF 4b10 上测试,它看起来非常接近。下面的代码是我在这里经过多次迭代后得到的。我确信它可以改进(即更好地重用 css 类),但这是在遥远的 future 某个时候的答案 3.0 ;)

原始代码在这里:http://jsfiddle.net/vSqR3/19/

并测试新的:http://jsfiddle.net/vSqR3/62/

<html>
<head>
<style type="text/css">
.noBullets {
list-style-type: none;
}
.containerDiv {
margin-left:0px;
border-width:1px;
border-color:#333;
border-top-style:none;
border-right-style:none;
border-left-style:none;
border-bottom-style:solid;
width: 284px;
height:20px;
}
.containerDivNoBorder {
margin-left:0px;
border-top-style:none;
border-right-style:none;
border-left-style:none;
border-bottom-style:none;
width: 284px;
height:20px;
}
.floatingLabel {
width: 160px;
height:20px;
float:left;
border-style:none;
}
.floatingShort {
border-width:1px;
border-color:#333;
border-top-style:none;
border-right-style:none;
border-left-style:solid;
border-bottom-style:none;
width: 39px;
height:20px;
float:left;
}
.floatingMedium {
border-top-style:none;
border-width:1px;
border-color:#333;
border-right-style:none;
border-left-style:solid;
border-bottom-style:none;
width: 80px;
height:20px;
float:left;
}
.floatingLong {
border-top-style:none;
border-width:1px;
border-color:#333;
border-right-style:none;
border-left-style:solid;
border-bottom-style:none;
width: 120px;
height:20px;
float:left;
}
.floatingLongBorder {
border-top-style:none;
border-right-style:none;
border-left-style:solid;
border-width:1px;
border-color:#333;
border-bottom-style:solid;
width: 120px;
height:20px;
float:left;
}
</style>
</head>
<body>
<form id="form" name="form" method="post" action="send.html">
<ul class="noBullets">
<h3>USER ACCOUNT</h3>
<li class="containerDiv">
<label class="floatingLabel">NAME</label>
<input class="floatingLong" type="text" name='name'/>
</li>
<li class="containerDiv">
<label class=floatingLabel>SURNAME</label>
<input class=floatingLong type="text" name='surname'/>
</li>
<li class="containerDiv">
<label class="floatingLabel">BIRTHDAY</label>
<input class="floatingShort" type="text" name='bd_d'/>
<input class="floatingShort" type="text" name='bd_m'/>
<input class="floatingShort" type="text" name='bd_y'/>
</li>
<li class="containerDiv">
<label class="floatingLabel">GENDER</label>
<input class="floatingShort" type="text" name='gender1'/>
<input class="floatingMedium" type="text" name='gender2'/>
</li>
<li class="containerDiv">
<label class="floatingLabel">USERNAME</label>
<input class="floatingLong" type="text" name='username'/>
</li>
<li class="containerDivNoBorder">
<label class="floatingLabel">E-MAIL</label>
<input class="floatingLongBorder" type="text" name='email1'/>
</li>
<li class="containerDiv">
<label class="floatingLabel">RE-TYPE E-MAIL</label>
<input class="floatingLong" type="text" name='email2'/>
</li>
<li class="containerDivNoBorder">
<label class="floatingLabel">PASSWORD</label>
<input class="floatingLongBorder" type="password" name='password1'/>
</li>
<li class="containerDiv">
<label class="floatingLabel">RE-TYPE PASSWORD</label>
<input class="floatingLong" type="password" name='password2'/>
</li>
<input type="submit" value="Submit" />
</ul>
</form>
</body>
</html>

关于html - 我们如何使用 css 和 html 制作这样的表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5482281/

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