html基础课(中)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<!--块级元素(block element):
table、p、ol、ul、li、form、div、hr、hn(h1、h2、h3、h4、h5、h6)等元素称为块级元素,特点:块级元素自动换行且宽度默认情况下占满整个父元素。
行内元素(inline element):
i、b、del、a、img、span, input、select、textarea、label 等元素称为行内元素,又称为内联元素、内嵌元素、直进式元素,特点:行内元素不会自动换行,相邻行内元素可以排在同一行。
注意
块级元素与行内元素可以通过display样式属性互相切换。
-->
<!--行内元素,长度和宽度包裹内容,不会自动换行-->
<img src="img/qq_logo_2x.png"/>
<a href="http://www.baidu.com" target="_blank" style="font-size: 36px;">百度</a>
<b>百度</b>
<i>百度</i>
<del>百度</del>
<span>百度</span>
<!--块级元素,长度填充整个父标记,高度包裹内容,单独成行-->
<p style="text-align: center;">河南工业大学</p>
<p style="text-align: center;">郑州大学</p>
<!--hn n 1~6-->
<h1 style="text-align: center;">河南工业大学</h1>
<h6 style="text-align: center;">河南工业大学</h6>
<!--有序列表(ordered list)-->
<ol type="a" start="3">
<li>语文</li>
<li>数学</li>
<li>英语</li>
</ol>
<!--无序列表(unordered list)-->
<ul type="circle" start="3">
<li>物理</li>
<li>化学</li>
<li>生物</li>
</ul>
</body>
</html>
表格:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
table{
border:1px solid black;
border-spacing: 0px;
border-collapse:collapse ;
}
th,td{
border:1px solid black
}
</style>
</head>
<body>
<table>
<!--跨行合并rowspan="3(需要合并的行数)"
跨列合并colspan="2(需要合并的列数)"
-->
<tr>
<th>序号</th><th>姓名</th><th>年龄</th><th>手机号</th><th>家庭住址</th>
</tr>
<tr>
<td>1</td><td>Jim</td><td>16</td><td>110</td><td>郑州</td>
</tr>
<tr>
<td>2</td><td>Jack</td><td>17</td><td>112</td><td>开封</td>
</tr>
<tr>
<td>3</td><td>Jim</td><td>18</td><td>119</td><td>洛阳</td>
</tr>
</table>
</body>
</html>
form表单:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<!--form表单,用来向服务器传递数据的-->
<form>
<!--隐藏框-->
<input type="hidden" />
<!--文本框-->
<input type="text" placeholder="请输入用户名"/>
<!--密码框-->
<input type="password " placeholder="请输入密码"/>
<!--文件框-->
<input type="file" />
<!--下拉列表-->
<select>
<option>--请选择省份--</option>
<option>河南省</option>
<option>河北省</option>
<option>江西省</option>
<option>湖南省</option>
<option>安徽省</option>
<option>浙江省</option>
</select>
<!--文本域-->
<textarea>
</textarea>
<!--单选框-->
<input type="radio" name="sex" id="male"/><label for="male">男</label>
<input type="radio" name="sex" id="female"/><label for="female">女</label>
<!--复选框-->
<input type="checkbox" name="hobby" id="basketball"/><label for="basketball">篮球</label>
<input type="checkbox" name="hobby" id="pingpang"/><label for="pingpang">乒乓球</label>
<input type="checkbox" name="hobby" id="football"/><label for="football">足球</label>
<!--按钮-->
<input type="button" value="登录"/>
<input type="button" value="提交"/>
</form>
</body>
</html>