兄弟,第五道是测试你html代码的基本功底吧,必填信息是加粗了,用<strong></strong>标签包起来,如果你样式没有设置居中或居右的话,默认是居左的,背景颜色你可以用截图工具把焦点放到颜色区域就可以看到rgb格式的颜色编码了。对于表格的效果我却认为基本一样就可以了,不必要完全一样。
个人认为这道题目用表格来布局是比较容易的,看不出html的基本功底。我是用div+css布局的,代码如下:
html页代码:login.html
- <html>
- <head>
- <title>登录页面</title>
- <link href="css/login.css" type="text/css" rel="stylesheet" />
- </head>
- <body>
- <div id="main" >
- <div id="top" class="row" ><strong>必填信息</strong></div>
- <div id="middle" >
- <form id="loginform" action="" method="post" onSubmit="" >
- <ul class="ul" >
- <li class="leftli"><lable for="loginname">登录名</lable></li>
- <li class="rightli"><span> </span><input type="text" id="loginname" name="loginname" />(只能用英文、数字和下划线)</li>
- <li class="leftli"><lable for="pwd">密码</lable></li>
- <li class="rightli"><span> </span><input type="password" id="pwd" name="pwd" />(密码必须大于5位,区分大小写)</li>
- <li class="leftli"><lable for="confirmpwd">确认密码</lable></li>
- <li class="rightli"><span> </span><input type="password" id="confirmpwd" name="confirmpwd" /></li>
- <li class="leftli"><lable for="email">邮件地址</lable></li>
- <li class="rightli"><span> </span><input type="text" id="email" name="email" /></li>
- <li class="leftli"><lable for="confirmemail">确认邮件地址</lable></li>
- <li class="rightli"><span> </span><input type="text" id="confirmemail" name="confirmemail" /></li>
- <li class="onlyli"><span></span><input type="submit" value="提 交" /> <input type="reset" value="重 填" /></li>
- </ul>
- </form>
- </div>
-
- </div>
- </body>
- </html>
复制代码 css文件代码:- *{
- margin:0px;
- padding:0px;
- }
- body{
- margin:0px;
- padding:0px;
- }
- #main{
- width:600px;
- margin:100px auto 0 auto;
- }
- .row{
- width:100%;
- height:30px;
- line-height:30px;
- border:1px solid #ccc;
- }
- #top{
- background-color:rgb(197,227,253);
- }
- #middle{
- width:100%;
- height:auto;
- background-color:rgb(247,247,247);
- }
- .ul{
- float:left;
- display:inline;
- }
- .ul, .ul li{
- list-style:none outside none;
- }
- .ul li{
- float:left;
- height:30px;
- line-height:30px;
- border:1px solid #ccc;
- }
- li span{
- display:inline-block;
- }
- .leftli{
- width:100px;
- text-align:right;
-
- }
- .rightli{
- width:496px;
- }
- .onlyli {
- width:596px;
- text-align:center;
- }
复制代码 |