DIV的表单布局
表单布局其实用表格最好了,可是表格的话,无法定位,这个是一个硬伤。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>表单布局</title>
<link rel="stylesheet" type="text/css" href="css/jnreset.css">
<style>
.formList{ margin:2px 0;}
.formList:before,.formList:after {content:""; display:table;}
.formList:after { clear:both; }
.formList{ zoom:1;}
.formList .formTit{ width:100px; line-height:30px; float:left; text-align:right;}
.formList .formMain{ margin-left:100px; padding-top:2px;}
.formList .formMain input{position:relative;top:2px;}
.formList .formMain select{position:relative;top:4px;}
.formList .formMain label{ margin-right:20px;}
.formList .formMain label input{ margin-right:3px; top:2px;}
</style>
</head>
<body> <div class="formList">
<div class="formTit"><label for="name">姓名:</label></div>
<div class="formMain"><input type="text" id="name" /></div>
</div> <div class="formList">
<div class="formTit">性别:</div>
<div class="formMain"><input type="radio" name="sex" id="man" /><label for="man">男</label><input type="radio" name="sex" id="woman" /><label for="woman">女</label></div>
</div> <div class="formList">
<div class="formTit">性别:</div>
<div class="formMain"><input type="checkbox" name="sex" /><label>男</label><input type="checkbox" name="sex" /><label>女</label></div>
</div> <div class="formList">
<div class="formTit">性别:</div>
<div class="formMain">
<select>
<option>我的这个是什么情况</option>
</select>
</div>
</div> <div class="formList">
<div class="formTit">文件:</div>
<div class="formMain">
<input type="file" />
</div>
</div> <div class="formList">
<div class="formTit">备注:</div>
<div class="formMain">
<textarea></textarea>
</div>
</div> <div class="formList">
<div class="formTit"></div>
<div class="formMain">
<input type="button" value="登录" />
</div>
</div> </body></html>
DIV的表单布局的更多相关文章
- 基于表单布局:分析过时的table结构与当下的div结构
一些话在前面 最近做了百度前端学院一个小任务,其中涉及到表单布局的问题, 它要处理的布局问题:左边的标签要右对齐,右边的输入框.单选按钮等要实现左对齐. 从开始入门就被告知table布局已经过时了,当 ...
- 一步一步学习Bootstrap系列--表单布局
前言:Bootstrap 属于前端 ui 库,通过现成的ui组件能够迅速搭建前端页面,简直是我们后端开发的福音,通过几个项目的锻炼有必要总结些常用的知识,本篇把常用的Bootstrap表单布局进行归纳 ...
- Bootstrap -- 表格样式、表单布局
Bootstrap -- 表格样式.表单布局 1. 表格的一些样式 举例: <!DOCTYPE html> <html> <head> <meta http- ...
- JS实战 · 收缩菜单表单布局
获取节点的两种方式: 1.通过event对象的srcElement属性: 2.通过事件源对象用this传入. 代码如下: <html> <head> ...
- [WPF自定义控件库]简单的表单布局控件
1. WPF布局一个表单 <Grid Width="400" HorizontalAlignment="Center" VerticalAlignment ...
- Qt之表单布局(QFormLayout)
简述 QFormLayout管理输入型控件和关联的标签组成的那些Form表单. QFormLayout是一个方便的布局类,其中的控件以两列的形式被布局在表单中.左列包括标签,右列包含输入控件,例如:Q ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(55)-工作流设计-表单布局
系列目录 前言:这一节比较有趣.基本纯UI,但是不是很复杂 有了实现表单的打印和更加符合流程表单方式,我们必须自定义布局来适合业务场景打印!我们想要什么效果?看下图 (我们没有布局之前的表单和设置布局 ...
- BootStrap 智能表单系列 四 表单布局介绍
表单的布局分为自动布局和自定义布局两种: 自动布局就是根据配置项中第二级配置项中数组的长度来自动使用不同的bootstrap栅格,通过设置autoLayout为true可以实现自动布局 自动以布局就是 ...
- html5之table嵌入form表单布局(务必注意:table标签必须在form表单内部,不能再form表单外部!)
切记:用table标签来布局form表单元素,table标签必须放在form表单内部,否则可能会出现各种bug 原文地址:https://blog.csdn.net/weixin_43343144/a ...
随机推荐
- html5,表格
<table border="1"><caption>表格的实例</caption><tr><td>单元格</td ...
- Portal Page的呈現
先看一下在JSR168中提到的Portal page,可以了解一個Portal Page上大概有哪些element: OK...進入本次主題 PSML:PSML的全名是Portal Structure ...
- python爬虫学习记录
爬虫基础 urllib,urllib2,re都是python自带的模块 urllib,urllib2区别是urllib2可以接受一个Request类的实例来设置url请求的headers,即可以模拟浏 ...
- Ubuntu1404: 将VIM打造为一个实用的PythonIDE
参考: http://www.tuicool.com/articles/ZRv6Rv 说明: 内容非原创, 主要是做了整合和梳理. 在 ubuntu14.04 & debian 8 下测试通 ...
- linux之V4L2摄像头应用流程【转】
本文转载自:http://blog.csdn.net/tommy_wxie/article/details/11486907 对于v4l2,上次是在调试收音机驱动的时候用过,其他也就只是用i2c配置一 ...
- ubuntu屏幕分辨率问题
今天在ubuntu下工作时突然屏幕上下各出现了一个大概2厘米的黑条,感觉屏幕被横向拉长了,莫名其妙,开始以为简单的调整下分辨率就好了,在系统设置显示里面发现分辨率只有两个可选参数,并且对象为未知,由于 ...
- Google Map: JavaScript API RefererNotAllowedMapError
visite https://console.developers.google.com/apis/credentials and select the project you use. http:/ ...
- phpize的深入理解
安装(fastcgi模式)的时候,常常有这样一句命令:/usr/local/webserver/php/bin/phpize一.phpize是干嘛的?phpize是什么东西呢?php官方的说明:htt ...
- ecshop搜索出现相关商品的效果滑动下拉效果
ecshop搜索栏效果如下 所需要的样式我们可以复制到style.css里: /*搜索滑动效果*/ .Menu { position:absolute; top:30px; left:7px; wid ...
- SQL SERVER 数据库实用SQL语句
--查看指定表的外键约束 select * from sysobjects where parent_obj in( select id from sysobjects where name='表名' ...