第十一章表格表单的新增 以及触发BFC

it2024-07-16  39

表格和表单的新增

表格的新增 标题标签 caption caption-side:top(默认)/bottom 标题的位置 <table> <caption>标题</caption> </table> 列标题 th <tr> <th>姓名</th> <th>性别</th> <th>年纪</th> </tr> 行分组 表头 可选 表体 可以有多个 表尾 可选 列分组 colgroup span: 几列为一组 <colgroup> <col span="1" class="first"> <col span="2" class="second"> <col span="1" class="third"> </colgroup> 单元格之间的距离:border-spacing:数值+px 一般设置0。加在表格身上合并边框 border-collapse:collapse; 加在表格身上表格固定 table-layout:auto(自动)/fixed(固定) 加在表格身上 设置表格为fixed提高浏览器加载速度 垂直对齐方式 vertical-align: baseline/top/bottom/middle 可以在单元格中生效 表单的新增 单选框 name的属性必须有,且值必须一样才能够互斥,checked 默认选中 disabled 禁止选中<input type="radio" name="sex" checked><input type="radio" name="sex">女 多选框 checked 默认选中 disabled 禁止选中 <input type="checkbox" checked disabled>M416 <input type="checkbox">AKM 下拉列表 selected:默认选中 <select name="height" id=""> <option value="1">175</option> <option value="2" selected>176</option> </select> 多行文本域 禁止用户缩放:给textarea 添加 resize:none; <textarea name="" id=""></textarea> 文件上传 <input type="file"> 扩大表单选中范围 label for的属性值指向选择元素的id名 <label for="man"> <input type="radio" name="sex" id="man"></label> 表单字段集 fieldset 字段集标题 legend <fieldset> <legend>标题</legend> <input type="text"> </fieldset>

去掉表单元素获取焦点时候的边框

outline:none;

BFC

块级格式化上下文(独立渲染的区域)触发条件 float的值为left/rightposition的值为absolute/fixeddisplay的值inline-block/table-caption/table-cell/flex(弹性盒)/inline-flexoverflow的值为hidden/scroll/auto 特性 在BFC的区域,浮动元素的高度也会计算在内(解决高度塌陷)BFC的区域不会与浮动盒子重叠 (两栏布局)

计算属性

width: calc(100% - 300px) 计算符号两边一定要有空格

过渡 ie9及以下不支持

需要过渡的属性:transition-property:css属性过渡持续时间:transition-duration:数值+s/数值+ms 1s=1000ms过渡延迟时间:transition-delay:数值+s/数值+ms 1s=1000ms过渡执行效果:transition-timing-function:linear(匀速)复合写法:transition:需要过渡的属性 过渡持续时间 过渡延迟时间 过渡执行效果;(顺序不固定,出现一个时间或者两个时间的话,默认第一个时间为执行时间) transition: all 1s; 过渡所有的属性,过渡时间为1s

透明

background-color:rgba(0-255,0-255,0-255,0-1) 0表示完全透明 1表示不透明 值越小越透明
最新回复(0)