div中有两个input控件,怎样让这两个控件在div居中显示

beihua 2009-07-08 09:55:47
div中有两个input控件,怎样让这两个控件在div居中显示
...全文
1318 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
junyi2003 2009-07-09
  • 打赏
  • 举报
回复
如果不需要换行,请自己去掉<br/>

<!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>测试文档</title>
</head>
<body>
<div style="margin:0 auto" align="center">
<p>
Text1:<input type="text" />
<br />
Text2:<input type="text" />
</p>
</div>
</body>
</html>
cb1156 2009-07-08
  • 打赏
  • 举报
回复
DIV应该有 align属性吧....
蝶恋花雨 2009-07-08
  • 打赏
  • 举报
回复
<div style="margin:0 auto" align="center"><input type="text"/><input type="text"/></div>
<div style="margin-left:auto;margin-right:auto" align="center"><input type="text"/><input type="text"/></div>

Coding_Playing_Boy 2009-07-08
  • 打赏
  • 举报
回复
你给两个input放到table里,在设置algin比较好,总之方法多着呢

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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