简简单单玩转CSS3(2)

雷型
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<p style="margin: 0;background:orange;height: 2em;width: 1em; ">&nbsp;</p>
	<p style="margin: 0;background:orange;height: 2em;width: 1em;position:relative;top: -1em;right: -1em;  ">&nbsp;</p><br><br>
	<p style="margin: 0;background:cyan;height: 2em;width: 1em;float: left; ">&nbsp;</p>
	<p style="margin: 0;background:cyan;height: 2em;width: 1em;position:relative;top: -1em;right: -1em;  ">&nbsp;</p>
</body>
</html>
河图
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		div{
			height: 33%;
			width: 33%;
			border:1px solid black;
			font-family: 楷体;
			font-size: 50px;
			text-align: center;
			position: fixed;
		}
		#jin{
			top: 33%;
			left: 33%;
			background-color: gold;
		}
		#mu{
			background-color: cyan;
		}
		#shui{
			left: 66%;
			background-color: lightblue;
		}
		#huo{
			top: 66%;
			background-color: red;
		}
		#tu{
			top: 66%;
			left: 66%;
			background-color: brown;
		}
	</style>
</head>
<body>
	<div id="jin"></div>
	<div id="mu"></div>
	<div id="shui"></div>
	<div id="huo"></div>
	<div id="tu"></div>

</body>
</html>
区别
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		p{
			display: block;
			font-size: 30px;
		}
		span{
			display: inline;
			font-size: 60px;

		}
		#out{
			color: cyan;
			border:2px dotted blue;
			position: relative;
			top: -12px;
		}
		#in{
			float: left;
			position: absolute;
			border:5px dotted green;
			color: red;
		}
	</style>
</head>
<body>

	<p id="out">aaaaaaaa</p>
	<span id="in"> bbbbbb</span>
</body>
</html>
Z序
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		.size{
			position: absolute;
			width: 300px;
			height: 300px;
		}
		#a{
			background-color: cyan;
			border:2px solid yellow;
			left: 100px;
			top: 200px;
			z-index: 1;
		}
		#b{
			background-color: lightblue;
			border:2px dotted black;
			left: 200px;
			top: 300px;
			z-index: 3;
		}
		#c{
			background-color: green;
			border:2px solid red;
			left: 300px;
			top: 400px;
			z-index: 2;
		}
	</style>
</head>
<body>
	<div class="size" id="a">aaaaaa</div>
	<div class="size" id="b">bbbbbb</div>
	<div class="size" id="c">cccccc</div>
</body>
</html>
表格
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		table{
			border-collapse: collapse;
			border:2px solid yellow;
		}
		colgroup,tbody{
			border:solid medium;
		}
		td{
			border:solid thin;
			height: 1.4em;
			width: 1.4em;
			text-align: center;
		}
	</style>
</head>
<body>
	<table>
		<colgroup>
			<col><col><col>
		</colgroup>
		<colgroup>
			<col><col><col>
		</colgroup>
		<colgroup>
			<col><col><col>
		</colgroup>
		<tbody>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
			<tr><td>1</td><td>2</td><td></td><td>5</td><td>1</td><td>2</td><td></td><td>5</td><td>9</td></tr>
		</tbody>
	</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		body{
			text-align: center;
		}
		stack{
			display:inline-table;
			border:2px solid red;
		}
		row{
			display: table-row;
			border:2px dotted black;
		}
		d{
			display: inline;
			font-weight: bolder;
			border:2px solid yellow;
		}
	</style>
</head>
<body>
	<stack>
		<row>1<d>2</d>3</row>
		<row>4<d>5</d>6</row>
		<row>7<d>8</d>9</row>
	</stack>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

莫余

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值