赞
踩
<tr>
标签内。<table border="x"> <!-- 边框宽度为x -->
<caption>标题</caption>
<tr>
<th></th>
<td></td>
<td></td>
</tr>
</table>
<html> <head> <title>表格</title> </head> <body> <table border="3"> <!-- 边框宽度为3 --> <caption>课程表</caption> <tr> <th></th> <th>Monday</th> <th>Tuesday</th> <th>Wednesday</th> <th>Thursday</th> <th>Friday</th> </tr> <tr> <th>第一节</th> <td>语文</td> <td>数学</td> <td>英语</td> <td>物理</td> <td>化学</td> </tr> <tr> <th>第二节</th> <td>生物</td> <td>语文</td> <td>数学</td> <td>英语</td> <td>物理</td> </tr> </table> </body> </html>
border-collapse: collapse; /* 边框合并 */
border-collapse: separate; /* 边框分离 */
border-collapse: separate; /* 边框分离 */
border-spacing: 5px 10px /* 横向 纵向*/
caption-side: top; /* 把标题放在表格上面。*/
caption-side: bottom; /* 把标题放在表格下面。*/
<tr>
<th scope="col">星期一</th> <!-- 把<th>标识为列的表头-->
<th scope="col">星期二</th> <!-- 把<th>标识为列的表头-->
</tr>
<tr>
<th scope="row">第一节</th> <!-- 把<th>标识为行的表头-->
<td>语文</td>
</tr>
<form>
:定义供用户输入的表单标签。<input>
:输入标签。action
属性:规定当提交表单时,向何处发送表单数据——用于动态网页,了解即可。method
属性:规定发送表单数据的方式 【URL 变量(method=“get”)或者 HTTP post (method=“post”)】——用于动态网页,了解即可。type
属性:定义输入类型,如文本域text
、密码字段password
、提交按钮submit
。name
属性:定义表单的名称,用于在表单提交之后引用表单数据,或者在 JavaScript 中引用元素——用于动态网页,了解即可。placeholder
属性:定义输入框中的提示信息。<form>
<input type="~~~" name="~~~" placeholder="~~~">
</form>
<html>
<head>
<title>表单</title>
</head>
<body>
<form>
账号:<input type="text" name="user_acount" placeholder="请输入学号"><br>
密码:<input type="password" name="user_password"><br> <!-- 默认隐藏输入的内容 -->
<input type="submit" value="提交"> <!-- 此处的value用于定义按钮上的文字 -->
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>文本域</title>
</head>
<body>
<form>
姓名:<input type="text" name="user_name"><br>
学号:<input type="text" name="user_id">
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>密码字段</title>
</head>
<body>
<form>
账号:<input type="text" name="user_accound"><br>
密码:<input type="password" name="user_password"> <!-- 默认隐藏输入的内容 -->
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>表单</title>
</head>
<body>
<form>
<input type="radio" name="user_sex" value="Man">男<br> <!-- 选择此项后提交的值即为value的值 -->
<input type="radio" name="user_sex" value="Woman">女
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>表单</title>
</head>
<body>
<form>
<input type="checkbox" name="user_career" value="Programmer">我是程序员<br> <!-- 选择此项后提交的值即为value的值 -->
<input type="checkbox" name="user_career" value="Superhero">我是超级英雄
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>表单——下拉选择框</title>
</head>
<body>
<form>
你喜欢的水果是:
<select>
<option value="苹果">苹果</option>
<option value="香蕉">香蕉</option>
<option value="葡萄">葡萄</option>
</select>
</form>
</body>
</html>
网页效果:
<html>
<head>
<title>表单</title>
</head>
<body>
<form>
<input type="text" name="user_name" placeholder="请输入姓名"><br> <!-- 与例一的区别就是通过 placeholder 设置了提示信息 -->
<input type="text" name="user_id" placeholder="请输入学号"><br>
<input type="submit" value="提交">
</form>
</body>
</html>
网页效果:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。