<p> 姓名</p>
<p><input name = 'name' type = 'text' value = 'Paul Pierce' size="140"></p>
<p> 地址<input name = 'address' type = 'text' value = 'Boston'></p>
<p> 电话号码<input name = 'phone' type = 'text' value = '15982884489'></p>
<p> 身份证号码<input name = 'idcard' type = 'text' value = '51312511940404041X' ></p>
<p> 密码<input name = 'passwd' type = 'text' value = '666666'></p>
</form>
这部分代码如下。。可是我实在不知道为什么文本和文本框对不准
还有如果要把文本框做自适应 应该如何做呢??
Html 关于文本与文本框排列的问题
答案:3 悬赏:0 手机版
解决时间 2021-02-26 06:49
- 提问者网友:佞臣
- 2021-02-25 06:46
最佳答案
- 五星知识达人网友:过活
- 2021-02-25 07:14
给你一个建议:不要太急躁,另外试着去看看html css这方面的书籍,先将基础打好,后续才不会一直感觉自己做项目太过于肤浅,没有信心。这个是用div+css对网站布局,一下纯手打
<html>
<head>
<title>用户信息</title>
<style type="css/txt">
#contents
{
width:1000px;
margin:0 auto;
}
dl dt
{
width:150px;
text-algin:right;
height:20px;
line-height:20px;
}
dl dd
{
width:400px;
height:20px;
}
dl dd input
{
line-height:20px;
width:250px;
}
</style>
</head>
<body>
<div id="contents">
<dl>
<dt>姓名:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
<dl>
<dt>地址:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
<dl>
<dt>电话号码:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
</body>
</div>
</html>
<html>
<head>
<title>用户信息</title>
<style type="css/txt">
#contents
{
width:1000px;
margin:0 auto;
}
dl dt
{
width:150px;
text-algin:right;
height:20px;
line-height:20px;
}
dl dd
{
width:400px;
height:20px;
}
dl dd input
{
line-height:20px;
width:250px;
}
</style>
</head>
<body>
<div id="contents">
<dl>
<dt>姓名:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
<dl>
<dt>地址:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
<dl>
<dt>电话号码:</dt>
<dd><input name = 'name' type = 'text' value = 'Paul Pierce' ></dd>
</dl>
</body>
</div>
</html>
全部回答
- 1楼网友:胯下狙击手
- 2021-02-25 09:16
可以给p加个line-height
- 2楼网友:我住北渡口
- 2021-02-25 08:34
可以设置style样式。 vertical-align: 值有top,上对齐,middle:让文本在input的中间,bottom下对齐,
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯