请问?怎么设置两行之间的距离呢???

11097082 2006-06-06 10:25:28
------------------------------------------
定义了line-height,但是当文字与input在一起的时候,line-height就不起作用了。
请问如何解决问题??
html代码如下:
---------------------------------------
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css" >

td{
font-size:14pt;
line-height:36px;

}

.input {
border-top: thin none #0033FF;
border-right: thin none #0033FF;
border-bottom: 1px solid black;
border-left: thin none #0033FF;
font-size:12px;
text-align:left;

}
.input1 {
border-top: thin none #0033FF;
border-right: thin none #0033FF;
border-bottom: thin none #0033FF;
border-left: thin none #0033FF;
font-size:12px;
text-align:center;

}
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td >  缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊:
<br />
  缩短发发送多幅撒发斯蒂芬啊
<input name="S_1_1" type="text" class="input" id="S_1_1" style="width:5%; " />
<input name="S_1_2" type="checkbox" id="S_1_2" value="checkbox" />
个/
<input name="S_1_3" type="checkbox" id="S_1_3" value="checkbox" />
东方宫/
<input name="S_1_4" type="checkbox" id="S_1_4" value="checkbox" />
儿童/
<input name="S_1_5" type="checkbox" id="S_1_5" value="checkbox" />
我二、为人为
<input name="S_1_6" type="text" class="input" id="S_1_6" style="width:7%" />
的豆腐干豆腐干权。缩短发所附撒大幅度反对法(
<input name="S_1_7" type="text" class="input1" id="S_1_7" style="width:5%" />
)个分
<input name="S_1_8" type="text" class="input" id="S_1_8" style="width:7%" />
更多,儿童儿童儿童儿童沃尔特维尔(
<input name="S_1_9" type="text" class="input1" id="S_1_9" style="width:5%" />
)额
<input name="S_1_10" type="text" class="input" id="S_1_10" style="width:7%" />
号。 豆腐干豆腐干
<input name="S_1_11" type="text" class="input" id="S_1_11" style="width:7%" />
东方宫。地非固定扶过
<input name="S_1_12" type="text" class="input" id="S_1_12" style="width:8%" />
,圈儿侮辱
<input name="S_1_13" type="text" class="input" id="S_1_13" style="width:5%" />

<input name="S_1_14" type="text" class="input" id="S_1_14" style="width:3%" />

<input name="S_1_15" type="text" class="input" id="S_1_15" style="width:3%" />
日止。 <br />
  缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊缩短发发送多幅撒发斯蒂芬啊</td>
</tr>
</table>
</body>
</html>
...全文
722 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
doudou_sha 2006-06-08
  • 打赏
  • 举报
回复
使用表格好一点...
11097082 2006-06-07
  • 打赏
  • 举报
回复
up
cgfans 2006-06-07
  • 打赏
  • 举报
回复
用表格控制吧~ 比较方便 全写在一个TD里面有点不好排的~
littlebest 2006-06-07
  • 打赏
  • 举报
回复
用padding试试
loverworld 2006-06-06
  • 打赏
  • 举报
回复
楼上的说的对!
careast 2006-06-06
  • 打赏
  • 举报
回复
cellspacing
11097082 2006-06-06
  • 打赏
  • 举报
回复
大家再来研究一下啊
11097082 2006-06-06
  • 打赏
  • 举报
回复
首先多谢大家!

用了 height:36px; 或者margin-top:18px 都达到了向上格开18PX的空白,实现用LINE-HEIGHT:36PX来控制文字行距的效果。

但是向下依然没有没有效果。用了margin-bottom:18px,结果是input对象向上移动了18px。
ilvs 2006-06-06
  • 打赏
  • 举报
回复
line-height是用来定义文本的,input是表单对象,不过可以通过input的高度,和定义margin-top,margin-bottom来调整。
大猫钓鱼 2006-06-06
  • 打赏
  • 举报
回复
line-height:<数字> | <长度> | <百分比>

最好用百分比 ^_^
孟子E章 2006-06-06
  • 打赏
  • 举报
回复

.input {
border-top: thin none #0033FF;
border-right: thin none #0033FF;
border-bottom: 1px solid black;
border-left: thin none #0033FF;
font-size:12px;
text-align:left;
height:36px;
}
.input1 {
border-top: thin none #0033FF;
border-right: thin none #0033FF;
border-bottom: thin none #0033FF;
border-left: thin none #0033FF;
font-size:12px;
text-align:center;
height:36px;

}
unotfish 2006-06-06
  • 打赏
  • 举报
回复
<head></head>之间加<style>td{line-height:150%}</style>
unotfish 2006-06-06
  • 打赏
  • 举报
回复
表格是cellspacing
段落间距是 line-height

61,114

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧