css盒子模型

仔细看凡云阁下面的图,理解CSS盒子模型的结构。

再仔细看下面的代码:

<style type="text/css">
		#father {
			display: inline-block;
			border: 1px solid blue;
			}
		#son {
			display: inline-block;
			padding: 20px 50px;
			border: 5px solid red;
			margin: 30px 80px;
		}
		.brother {
			height: 20px;
			background-color: aqua;
			
		}
	
		</style>
	</head>
	<body>
	<div id="father">
	<div class="brother"></div>
	<div id="son">这是内容</div>
	<div class="brother"></div>
	</div>	

效果如下:


本文固定链接: http://www.fanyun.ltd/2038.html | 凡云阁

fanyun
作者:fanyun 于2023年02月10日发表 & 关键词:
除非注明 否则文章均为原创,转载请注明出处: css盒子模型 | 凡云阁
【上一篇】
【下一篇】

css盒子模型:等您坐沙发呢!

发表评论

亲,不支持纯字母、符号评论哦~