.customContainer{
	height: 40px;
	margin: 0 auto;
	background-color: purple;
}

@media screen and (max-width: 768px){
	.customContainer{
		width: 100%;
	}
}

@media screen and (min-width: 768px) and (max-width: 992px){
	.customContainer{
		width: 750px;
	}
}

@media screen and (min-width: 992px) and (max-width: 1200px){
	.customContainer{
		width: 970px;
	}
}
<div class="customContainer"></div>

@media媒体查询的使用方法及注意事项
@media媒体查询的使用方法及注意事项
注意:‘and’后一定要加空格,否则媒体查询无效

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-19
  • 2021-05-25
  • 2021-10-28
  • 2021-10-05
  • 2021-10-18
  • 2021-12-16
相关资源
相似解决方案