博客列表 >css盒子哎

css盒子哎

无耻的鱼
无耻的鱼原创
2018年03月22日 23:19:23700浏览

总结

  • width 宽

  • height 高

  • table里的图片

  • 将方形框或图片变成圆形  border-radius=50%


实例

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>赛跑排名</title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
			font-size: 32px;
		}
		caption{
			color: red;
			margin-bottom: 20px;
		}
		table{
			box-shadow: 3px 3px 5px 4px #ccc;
			margin: 10px auto;
			border-collapse: collapse;
			/*合并边框*/
		}
		table,th,td{
			border: 1px solid black;		
			text-align: center;	
		}
		th,td{
			padding: 2px;
			width: 300px;
			height: 100px;
		}
		tr:nth-child(1){
			background-color: #ccc;
		}
		img{
			width: 100px;
			height: 100px;
			border-radius: 50%;
			box-shadow:0 1px 5px 3px #ccc;
		}
	</style>
</head>
<body>
<table>
	<caption>§ 赛跑排名 §</caption>
	<tr>
		<th>照片</th>
		<th>名字</th>
		<th>年龄</th>
		<th>名次</th>
	</tr>
	<tr>
		<td><img src="https://img.php.cn/upload/manual/000/000/001/591014544d28e651.jpg"></td>
		<td>html</td>
		<td>5</td>
		<td>3</td>
	</tr>
	<tr>
		<td><img src="https://img.php.cn/upload/manual/000/000/001/59100fa44850f635.jpg"></td>
		<td>js</td>
		<td>3</td>
		<td>1</td>
	</tr>
	<tr>
		<td><img src="https://img.php.cn/upload/manual/000/000/001/59100f14e23b7926.jpg"></td>
		<td>css</td>
		<td>4</td>
		<td>4</td>
	</tr>
	<tr>
		<td><img src="https://img.php.cn/upload/manual/000/000/001/591010919d269341.jpg"></td>
		<td>ajax</td>
		<td>6</td>
		<td>2</td>
	</tr>
</table>
</body>
</html>

运行实例 »

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

0322.png

上一条:03 .22作业下一条:3月16日作业
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议