day11 布局

导航栏结构

<div class="wrapper">
	<div class="content"></div>
</div>
.wrapper{
	height:25px;
	background-color: red;
}

.content{
	height:25px;
	width:1200px;
	margin:0 auto;
	background-color: black;
}

父级设置一个高度,宽度自适应屏幕。子级的左右margin设置auto,当浏览器的窗口缩小在一定程度内,内容区不会被缩小。
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/LGT970116/article/details/82889131