关于css:day9-表单和表格的补充

6次阅读

共计 725 个字符,预计需要花费 2 分钟才能阅读完成。

1. 表单的补充

(1) 单选框

<input type='radio'> 单选内容 
  • type 为 radio, 代表单选框
  • 当 name 属性值一样时,能够互斥
  • 绑定信息 lable 标签,点击字的时候, 也能抉择到圈
<label for="woman"> for 属性指向 id 名
    <input type="radio" name="sex" id="woman"> 女 
</label>
  • 默认抉择:checked (相当于 checked=’checked’)
  • 禁止抉择:disabled

(2) 多选框

<input type='checkbox'> 多选内容    
  • type 为 checkbox, 代表多选框

(3) 下拉列表

<select>
    <option> 下拉内容 </option>
</select>
  • 默认抉择:selected

(4) 多行文本域

<textarea></textarea>
  • 禁止缩放

    textarea{resize:none;}

(5) 文件上传

<input type='file'>

(6) 表单字段集

<fieldset>
    <legend> 字段集题目 </legend>
    表单元素
</fieldset>

2. 表格的补充

(1) 表格题目 caption

(2) 表格列题目 th

(3) 表格行分组 thead tbody tfoot

<thead></thead> 表头  个别只有一组 
<tbody></tbody> 表体 能够有多组 
<tfoot></tfoot> 表尾 个别只有一组 

(4) 加在 table 身上的属性

  • border-spacing: 数值 +px

    • 边框之间的间距
  • border-collapse: collapse

    • 合并边框线,变成细线边框
  • table-layout: auto(主动)/fixed(固定)

    • 设置固定后,不让表格依据内容去撑大宽度,所以有利于浏览器放慢运行速度
正文完
 0