css011 表格和表单的格式化

一、    让表格专司其职

   Html中创建一个三行三列的表格

<table>

<caption align="bottom">

table 1:cosmofarmer.com's indoor mower roundup

</caption>

<colgroup>

<col id="brand"></col>

<col id="price"></col>

<col id="power"></col>

</colgroup>

<thead>

<tr>

<th scope="col">brand</th>

<th scope="col">price</th>

<th scope="col">power</th>

</tr>

</thead>

<tbody>

<tr>

<td>hello</td>

<td>$988</td>

<td>lal</td>

</tr>

<tr>

<td>hi</td>

<td>$1000</td>

<td>lalala</td>

</tr>

</tbody>

</table>

用到的标签比较多<table> <caption> <colgroup> <col>  <thead> <tr> <th> <td>

二、    给表格定义样式

1、添加padding

td{padding:10px 5px 2px 6px;}

2、调整垂直对齐和水平对齐

text-align和vertical-align

text-align控制水平定位方向

值:left right center justify

table {text-align:center; }

vertical-align调整垂直定位方向

值:top baseline middle bottom

3、创建边框border

控制表格之间的空格

border-spacing:5px;

table{ border-spacing:5px; }

4、消除双边框

table{ border-collapse:collapse; }

5、圆角

border-radius

td{

border:1px solid black;

border-radius:5px;

}

6、给行和列定义样式

tr:nth-of-type(odd) {background-color:red;}

tr:nth-of-type(even) {background-color:blue;}

td:nth-of-type(odd) {background-color:red;}

td:nth-of-type(even) {background-color:red;}

三、    给表单定义样式

font  background-color color margin padding等

1、html表单元素

<fieldset>

<legend></legend>

</fieldset>

text fields(文本域)

button

drop-down menus(下来菜单)

checkbox(复选框)

2、利用css布置表单

a、 每一个label标签都用一个tag标签包围起来

b、用display属性值设为inline-block,并设置宽度

.albel{

display:inline-block;

width:20px;

}

c、 调整样式

.albel{

float:left;

width:20px;

vertical-align:top;

text-align:right;

margin-top:20px;

}

css011 表格和表单的格式化的更多相关文章

  1. CSS3-animation,表格表单的格式化

    animation 1.与transition一样,animation在IE9之前都不支持,不仅如此,还需要大量的供应商前缀 2.定义关键帧:@内容中需要大量的前缀 @keyframes  fadeI ...

  2. DOM之表格与表单基础分享

    我是沐晴,好久不见.马上要放假啦,也是比较的忙. 今天来谈谈表格和表单的基本知识.前期的写的都是比较基础的知识,后期会慢慢增加实例.一起来学习吧. 先看表格,DOM中提供了一些属性,便于我们获取表单节 ...

  3. BootStrap入门教程 (二) :BASE CSS(排版(Typography),表格(Table),表单(Forms),按钮(Buttons))

    上讲回顾:Bootstrap的手脚架(Scaffolding)提供了固定(fixed)和流式(fluid)两种布局,它同时建立了一个宽达940px和12列的格网系统. 基于手脚架(Scaffoldin ...

  4. 第3天:CSS浮动、定位、表格、表单总结

    今天学的是浮动.定位.表格.表单等内容,这些是CSS中最容易混淆的知识,有许多小技巧在写代码过程中需要注意.下面是主要知识点: 一.float浮动1.块元素在一行显示2.内联元素支持宽高3.默认内容撑 ...

  5. WEB入门二 表格和表单

    学习内容 Ø        表格的作用和制作 Ø        表单的制作 能力目标 Ø        掌握表格的创建 Ø        掌握设置表格的常用属性: Ø        理解表单的作用 Ø ...

  6. HTML&CSS精选笔记_表格与表单

    表格与表单 表格标记 创建表格 要想创建表格,就需要使用表格相关的标记 <table>     <tr>     <td>单元格内的文字</td>   ...

  7. Unit01: Web概述 、 HTML概述 、 文本处理 、 图像和超链接 、 表格 、 表单

    Unit01: Web概述 . HTML概述 . 文本处理 . 图像和超链接 . 表格 . 表单 demo1.html <!-- 声明网页的版本(文档类型) --> <!doctyp ...

  8. 13、Semantic-UI之表格与表单

    13.1 定义基础样式表格   在HTML中可以通过table进行表格定义,在Semantic-UI中也可以通过class="ui table"定义表格. 示例:定义基础表格 &l ...

  9. 框架,表格,表单元素,css基础以及基本标签的结合

    <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo ...

随机推荐

  1. vim 快捷键

    1.vim ~/.vimrc 进入配置文件 如果不知道vimrc文件在哪,可使用 :scriptnames 来查看 set nu #行号 set tabstop=4 #一个tab为4个空格长度 set ...

  2. 东大OJ-1430-PrimeNumbers

    题目描述 I'll give you a number , please tell me how many different prime factors in this number. 输入 The ...

  3. iOS 'The sandbox is not sync with the Podfile.lock'问题解决

    问题描述: github下载的Demo,很多时候使用到CocoaPods,有的时候因为依赖关系或者版本问题不能编译运行.出现例如The sandbox is not sync with the Pod ...

  4. 59-chown 简明笔记

    改变文件的所有者或与文件相关联的组 chown [options] owner file-list chown [options] owner: group file-list chown [opti ...

  5. Bete冲刺第四阶段

    Bete冲刺第四阶段 今日工作: web: 昨晚搞得很晚,帮队友搞定了git的问题,仓库顿时干净多了,同时已经基本完成了基础功能的接口 ios: 导入并使用了改善交互的第三方开源库,修正路径BUG 目 ...

  6. android 监听短信并发送到服务器

    1. 接受系统的短信广播,操作短信内容. 优点:操作方便,适合简单的短信应用. 缺点:来信会在状态栏显示通知信息. 2. 应用观察者模式,监听短信数据库,操作短信内容.   实例如下: SystemE ...

  7. selector 和 shape结合使用

    <?xml version="1.0" encoding="utf-8"?><selector xmlns:android="htt ...

  8. mybatis和ibatis控制台打印sql语句方法

    #将ibatis log4j运行级别调到DEBUG可以在控制台打印出ibatis运行的sql语句 log4j.rootLogger=debug,stdout,logfile### 把日志信息输出到控制 ...

  9. 【CodeVS 1198】【NOIP 2012】国王游戏

    http://codevs.cn/problem/1198/ 推导一翻,排好序后,直接上高精度. #include<cstdio> #include<cstring> #inc ...

  10. 神经网络dropout

    训练集上面,加一个bool型的开关 做预测的时候,不需要打开开关,而是所有的数乘以p, 实际工业界做的时候是: 在训练的时候都除以p,在做预测的时候什么时候都不用干