Blogger Information
Blog 23
fans 1
comment 1
visits 22893
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
3.22用CSS制作一张信息表(盒子模型)
潮涌学习php的博客
Original
794 people have browsed it

这一节课学习了盒子模型和它的css属性。

上右下左:top,right,bottom,left

内边距:padding

外边距:margin

边框:border

圆角:border-radius:

阴影:box-shadow: 水平,垂直,扩展,颜色

3.22.jpg

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>3.22作业</title>
	<style type="text/css">
		/*给整个表格以及内部单元格加上边框*/
		table,th,td {
			border:2px solid red;
		}
		/*将所有的边框线进行折叠*/
		table{
			border-collapse:collapse;
			text-align:center; /*居中*/
			margin:20px auto;
			width:60%;
			background-image:url(images/bg.jpg);
			background-repeat:no-repeat;
			background-size:cover;
			box-shadow:3px 3px 3px #888;
		}
		table caption{
			font-size:20px;
			font-weight:bolder;
			margin-bottom:20px;
		}
		th,td{
			padding:10px;
		}
		th{
			background-color:lightgreen;
		}
		/*设置图片*/
		th img {
			width:30px;
			border-radius:50%;
			box-shadow:-2px -2px 2px #888;
		}
		.zhongwu{
			color:blue;
			font-weight:bolder;
			background-color:rgba(35,155,0,0.3);
		}
	</style>
</head>
<body>
	<table>
		<caption>课程表</caption>
		<tr>
			<th>时间</th>
			<th><img src="images/1.jpg">星期一</th>
			<th><img src="images/2.jpg" alt="">星期二</th>
			<th><img src="images/3.jpg" alt="">星期三</th>
			<th><img src="images/4.jpg" alt="">星期四</th>
			<th><img src="images/5.jpg" alt="">星期五</th>
		</tr>
		<tr>
			<th rowspan="2">上午</th>
			<td>语文</td>
			<td>英语</td>
			<td>数学</td>
			<td>英语</td>
			<td>语文</td>
		</tr>
		<tr>
			<td>语文</td>
			<td>英语</td>
			<td>数学</td>
			<td>英语</td>
			<td>语文</td>
		</tr>
		<tr>
			<td colspan="6" class="zhongwu">中午休息</td>
		</tr>
		<tr>
			<th rowspan="2">下午</th>
			<td>语文</td>
			<td>英语</td>
			<td>数学</td>
			<td>英语</td>
			<td>语文</td>
		</tr>
		<tr>
			<td>语文</td>
			<td>英语</td>
			<td>数学</td>
			<td>英语</td>
			<td>语文</td>
		</tr>
	</table>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

3.22-1.jpg

3.22-2.jpg

3.22-3.jpg

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!