当前位置 : 主页 > 网页制作 > css >

块级div设置行宽,居中显示

来源:互联网 收集:自由互联 发布时间:2021-06-13
!DOCTYPE htmlhtmlheadmeta charset="utf-8" title登录/titlelink rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" script src="/uploads/allimg/210613/091I03509-0.jpg"/scriptscript src="/uploads/
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"> 
	<title>登录</title>
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="http://img.558idc.com/uploadfile/allimg/210613/091I03509-0.jpg"></script>
	<script src="http://img.558idc.com/uploadfile/allimg/210613/091I0EM-1.jpg"></script>
</head>
<body >

<div class="page-header text-center">
  <h1>摄影
    <small>展会</small>
  </h1>
</div>
<!--居中设置 margin:0 auto;--><!--块级设置行宽 width:300px;-->
<div style="background:green;margin:0 auto;width:300px;">   
<form role="form" >
<table class="table" style="width:400px">  
   <tbody >
      <tr>
         <div class="form-group">
             <td>
                <label for="name">名称</label>
             </td>
             <td>
                <input type="text" class="form-control" id="name" 
    			       placeholder="请输入名称" style="width:200px">
             </td>
         </div>
      </tr>
      <tr>
         <div class="form-group">
             <td>
                <label for="name">密码</label>
             </td>
             <td>
                <input type="password" class="form-control" id="name" 
			           placeholder="请输入密码" style="width:200px">
             </td>
         </div>
      </tr>
      <tr>
         <td>
            <button type="submit" class="btn btn-default">提交</button>
    
         </td>
         <td>
            <button type="submit" class="btn btn-default">注册</button>
         </td>
      </tr>
   </tbody>
</table>
</form>
</div>

</body>
</html>
上一篇:聊聊CSS3
下一篇:scss语法
网友评论