第16章 CSS盒模型[下]

index.html

<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<title>CSS盒模型[下]</title>
	<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

<!-- <div>我是HTML5</div>

sdfsdfsdf

<table border="1">
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
	</tr>
	<tr>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
</table> -->


<!-- <div>我是块级元素</div> -->

<!-- <span>我是行内元素</span> -->

<!-- <img src="img.png"> -->

<!-- <div>我是块级元素,将要转成行内元素</div> -->

<!-- <span>我是行内元素,将要转成块级元素</span> -->

<!-- <div>我是块级元素,将要转成行内块元素</div>

<span>我是行内元素,将要转成行内块元素</span>

sdfsd -->


<div id="a">我是a</div>

<div id="b">我是b</div>

<!-- <div id="c">我是c</div>

<div id="d">sdfsdfsdf</div> -->

</body>
</html>

 

style.css

@charset "utf-8";

/*
div {
	background: silver;
	width: 200px;
	height: 200px;
	/*visibility: visible;
	visibility: hidden;
	visibility: collapse;
}

table tr:first-child {
	visibility: hidden;
	visibility: collapse;
}
*/

/*div {
	background: silver;
	width: 200px;
	height: 200px;
}*/

/*span {
	background: silver;
	width: 200px;
	height: 200px;
}*/

/*img {
	width: 100px;
	height: 50px;
}*/

/*div {
	background: silver;
	width: 200px;
	height: 200px;
	display: inline;
}*/

/*span {
	background: silver;
	width: 200px;
	height: 200px;
	display: block;
}*/

/*div,span {
	background: silver;
	width: 200px;
	height: 200px;
	display: inline-block;
}

span {
	display: none;
}*/

div {
	width: 200px;
	height: 200px;
}

/*#a {
	background: maroon;
	float: left;
}
#b {
	background: green;
	float: left;
}
#c {
	background: blue;
	float: left;
}
#d {
	height: 300px;
	background: orange;
	float: left;
}*/

/*#a {
	background: maroon;
	float: right;
}
#b {
	background: green;
	float: left;
}*/

#a {
	background: maroon;
	float: left;
}
#b {
	background: green;
	float: none;
	clear: both;
}

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值