61,112
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<style>
#name {width:500px;background:#EEE;}
#name input{top:0px;
width:32.5%;
}
</style>
</head>
<body>
<div id="name">
<input type="text" />
<input type="text" />
<input type="text" />
</div>
</body>
</html>
expression只能在IE下用吧?
如果楼主不介意用table,可以试试
<html>
<body>
<style>
#name {width:500px;}
#name input{
width:100%;
/*如果你不设置table的间距的话width:100%可能会撑破,这样的话你可以设置width:96% 之类稍少一点的值*/
}
</style>
<table id="name">
<tr>
<td><input type="text" /></td>
<td><input type="text" /></td>
<td><input type="text" /></td>
</tr>
</table>
</body>
</html>
<html>
<body>
<style>
#name {width:500px;}
#name input{
width:expression(parseInt(document.getElementBy("name").style.width.replace("px",""),10)/3 + "px");
}
</style>
<div id="name">
<input type="text" />
<input type="text" />
<input type="text" />
</div>
</body>
</html>